标签:nts res class cee first otto ... pac after
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1179 Accepted Submission(s): 539
1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 using namespace std; 5 struct node 6 { 7 int a[1100]; 8 }s[1010]; 9 int main() 10 { 11 int i,j,t,n; 12 s[0].a[0]=1; 13 for(i=1;i<=1000;i++) 14 { 15 int r=0; 16 for(j=0;j<1000;j++) 17 { 18 s[i].a[j]=s[i-1].a[j]*2+r; 19 20 r=s[i].a[j]/10; 21 22 s[i].a[j]%=10; 23 24 } 25 t=0; 26 while(s[i].a[t]+1>9) 27 { 28 s[i].a[t]=0; 29 t++; 30 } 31 s[i].a[t]+=1; 32 } 33 while(scanf("%d",&n)!=EOF) 34 { 35 for(i=999;i>=0,s[n].a[i]==0;i--); 36 for(j=i;j>=0;j--) 37 printf("%d",s[n].a[j]); 38 printf("\n"); 39 40 } 41 return 0; 42 }
HDU 1592 Half of and a Half(大数)
标签:nts res class cee first otto ... pac after
原文地址:http://www.cnblogs.com/Annetree/p/6291875.html