Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
这两段代码应该没有大的区别吧??void getList() { int i,j; len[0]=len[1]=1; num[0][1]=1; num[1][1]=3; int c=0,t; for(i=2;i<=65;i++) { len[i]=len[i-1]; for(j=1;j<=len[i-1];j++) { t=num[i-1][j]*3; num[i][j+1]=(num[i][j]+t)/10; num[i][j]=(num[i][j]+t)%10; } if(num[i][j]) len[i]++; } } ======================================================== void getList() { int i,j; len[0]=1; num[0][1]=1; int t; for(i=1;i<=65;i++) { len[i]=len[i-1]; for(j=1;j<=len[i-1];j++) { t=num[i-1][j]*3; num[i][j+1]+=(num[i][j]+t)/10; num[i][j]=(num[i][j]+t)%10; } if(num[i][j]) len[i]++; } } ================================================================== 一个AC,一个WA......... 就是一个从2开始,一个从1开始........ Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator