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 |
自然是美妙的用数学方法判断时最好把t[0]=1也放进去,我之前调试得呕血... 改良后发现想不正确都难... t[0]=1; for (i1=0;i1<19;i1++) for (j1=0;j1<=i1;j1++) t[i1+1]=t[i1+1]+t[j1]*t[i1-j1]; ...... if (k==1) {printf("X"); return;} while (h+t[i]<=k) { h+=t[i]; i++; } l=--i; j=k-h; while (j-t[l]*t[i-l]>=0) { j-=t[l]*t[i-l]; l--; } q=j/t[l]; h=0; for (o=0;o<i-l;o++) h+=t[o]; h+=q; if (h>0) { printf("("); decide(h); printf(")"); } printf("X"); q=j%t[l]; h=0; for (o=0;o<l;o++) h+=t[o]; h+=q; if (h>0) { printf("("); decide(h); printf(")"); Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator