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 |
Re:为什么WA呢?程序如下In Reply To:为什么WA呢?程序如下 Posted by:yiyiyi4321 at 2005-08-04 18:09:01 当然是 WA ,你的程序对Sample 中的 6 3 2 3 -3 4 1 0 1 输出是错误的 建议把for循环变为: for(i=n;i>=k;i--) { if(a[i]==0) continue; else {a[i-k]-=a[i]; a[i]=0; } } 另外在输出时也要作一些判断 Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator