然而只能膜拜……
ORZ ORZ(这里)
1 2 2 4 4
1
1 1
2
1 1 1
1 2
1 1 1 1
1 1 2
2 2
4
1 1 1 1 1
1 1 1 2
1 2 2
1 4
1 1 1 1 1 1
1 1 1 1 2
1 1 2 2
1 1 4
2 2 2
2 4
1 1 1 1 1 1 1
1 1 1 1 1 2
1 1 1 2 2
1 1 1 4
1 2 2 2
1 2 4
1 1 1 1 1 1 1 1
1 1 1 1 1 1 2
1 1 1 1 2 2
1 1 1 1 4 (f[7]部分)
1 1 2 2 2
1 1 2 4
2 2 2 2(1 1 1 1)
2 2 4(1 1 2) (f[4]部分)
8(4)
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int maxn=1000010;
int f[maxn];
int main()
{
int n;
scanf("%d",&n);
f[1]=1;
for(int i=2;i<=n;i++)
if(i&1)f[i]=f[i-1];
else f[i]=(f[i-1]+f[i/2])%1000000000;
printf("%d",f[n]);
return 0;
}
——既然选择了远方,便只顾风雨兼程