递推1-1 2--2 3--2 4--4 5--4 6--6 7--6 8--10 9--10
所以当n为奇数f(n)=f(n-1) 偶数f(n)=f(n-1)+f(n/2)
#include<cstdio>
int d[1000010];
int main()
{
//freopen("jeslie.txt","r",stdin);
int n;
scanf("%d",&n);
d[0]=1;
for(int i=1;i<=1000000;i++)
{
if(i%2==1) d[i]=d[i-1];
else d[i]=d[i-1]+d[i/2];
d[i]%=1000000000;
}
printf("%d\n",d[n]);
return 0;
}