Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:为什么WA呢?程序如下

Posted by yiyiyi4321 at 2005-08-05 13:37:40 on Problem 2527
In Reply To:Re:为什么WA呢?程序如下 Posted by:xianyunsc at 2005-08-05 04:26:45
> 当然是 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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator