mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
da5da8ec9f
3100-3199
23 lines
372 B
C++
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;
|
|
}
|