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 0912070002 at 2010-06-10 15:47:12 on Problem 1247
In Reply To:请高手指点迷津,为什么WA ,谢谢 Posted by:382784268 at 2009-02-11 01:41:39
> #include<iostream>
> using namespace std;
> int main()
> {
> 	int d;
> 		
> 		while(cin>>d&&d)
> 		{
> 			int *p=new int [d] ;
> 			int i,j;
> 			for(i=0;i<d;i++)
> 				cin>>p[i];
> 			i=0;j=d-1;int s1=0,s2=0;
> 
> 			while(i<=j)
> 			{
> 				if(s1>s2)
> 					s2+=p[j--];
> 				else
> 					s1+=p[i++];
> 			}
> 		
> 
> 				
> 			
> 			if(s1!=s2)
> 				cout<<"No equal partitioning."<<endl;
> 			else
> 				cout<<"Sam stops at position "<<j+1<<" and Ella stops at position "<<i+1<<endl;
> 		}
> 		return 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