题述
输出输入
样例
代码
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
const int N=1000005;
const int mod=1e9;
int main()
{
int f[N];
int n;
cin>>n;
f[0]=1;
for(int i=1;i<=n;i*=2)
{
for(int j=i;j<=n;j++)
{
f[j]=(f[j+f[j-i]])%mod;
}
}
cout<<f[n]<<endl;
return 0;
}