OJ-Problems-Source/HDOJ/3164_autoAC.cpp
2016-09-01 20:51:58 +08:00

23 lines
372 B
C++

#include<cstdio>
#include<cmath>
int d[1000050]={1};
int f(int i)
{
if(d[i]==0)
{
double a=sin(i);
d[i]=f((int)(i-sqrt(i+0.0)))+f((int)log(i+0.0))+f((int)(i*a*a));
d[i]%=1000000;
}
return d[i];
}
int main()
{
int n;
while(scanf("%d",&n)&&n!=-1)
{
printf("%d\n",f(n));
}
return 0;
}