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 |
为什么这样能AC,这样就WAAC: temp1=r[k] / (n-1); temp2=r[k] % (n-1); int tt=0; r[k]=0; for (int i=1;i<=n;i++) { if (i==k) continue; r[i]+=temp1; if (tt!=temp2) { r[i]++; tt++; } } WA: temp1=r[k] / (n-1); temp2=r[k] % (n-1); r[k]=0; for (int i=1;i<=n;i++) if (i!=k) r[i]+=temp1; for (int i=1;i<=n;i++) { if (i!=k) { r[i]+=1; temp2--; if (temp2==0) break; } } 表示不解,哪位能帮忙解释下。 Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator