标签:des style blog http java color os strong
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 1328 Accepted Submission(s):
552
#include<iostream> #include<cstdio> #include<cmath> using namespace std; __int64 pow(int x,int y) { int i; __int64 sum=1; for(i=1;i<=y;i++) sum*=x; return sum; } int main() { __int64 temp,a[40],b[40]; int i; a[2]=b[2]=0; a[3]=8;b[3]=4; for(i=4;i<=31;i++) { a[i]=a[i-1]*4; a[i]+=pow(2,i)-4; temp=(pow(4,i-2)-pow(2,i-2))*2-b[i-1]; a[i]+=temp; b[i]=a[i-1]*2+temp; } for(i=2;i<=31;i++) printf("N=%d: %I64d\n",i,a[i]); return 0; }
HDU-1438 钥匙计数之一,布布扣,bubuko.com
标签:des style blog http java color os strong
原文地址:http://www.cnblogs.com/cancangood/p/3873841.html