hdu2709
奇数时dp[i]=dp[i-1]
偶数时dp[i]=dp[i-2]+dp[i/2]
#include <queue>
#include <cstdlib>
#include <cmath>
#include <cstdio>
#include <string>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int a[1000001],n;
a[1]=1;a[2]=2;a[3]=2;a[4]=4;a[5]=4;
for(int i=6;i<=1000000;i++)
a[i]=(a[i-2]+a[i/2])%1000000000;
while(~scanf("%d",&n))
{
printf("%d\n",a[n]);
}
return 0;
}