标签:printf str ++ open div scan stream png 简单
#include "iostream" #include "cstdio" using namespace std; #define LL long long #define N 100020 int a[N],b[N]; void init() { a[0]=0;a[1]=a[2]=1; b[0]=0;b[1]=b[2]=1; for(int i=3;i<N;i++){ if(i%2) a[i]=a[i/2]+a[i/2+1]; else a[i]=a[i/2]; b[i]=max(b[i-1],a[i]); } } int main(){ //freopen("in.txt","r",stdin); init(); int t,n; scanf("%d",&t); while(t--){ scanf("%d",&n); printf("%d\n",b[n]); } return 0; }
标签:printf str ++ open div scan stream png 简单
原文地址:http://www.cnblogs.com/kimsimple/p/7478652.html