|
|
back to boardGood solution #include <stdio.h> __int64 n, i, a[200002], b[200002], mx; void solve(){ a[1] = b[1] = mx = 1; for(i = 1 ; i < 100001 ; i ++){ a[i << 1] = a[i]; a[i << 1 | 1] = a[i] + a[i + 1]; if(mx < a[i]) mx = a[i]; b[i] = mx; } while(~scanf("%I64d", &n)){ if(!n) break; printf("%I64d ", b[n]); } } int main(){ solve(); } |
|
|