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 DieIng at 2008-05-13 15:18:06 on Problem 2348
In Reply To:为什么会WA??大虾帮忙~~~~ Posted by:ACrun at 2007-01-16 12:16:29
#include<iostream>
using namespace std;

int main()
{  
    long s,d,temp,flag;
	while(cin>>s>>d&&(d!=0&&s!=0))
	{
		if(s<d){temp=s;s=d;d=temp;}
		if(s/d>=2)cout<<"Stan wins"<<endl;
		flag=0;
		while(s%d!=0)
		{	
			temp=s;	
			s=d;
			d=temp%d;
			flag++;
		}
		if(flag%2)cout<<"Ollie wins"<<endl;
		else cout<<"Stan wins"<<endl;
	}
	return 0;
}


		这是我的算法。他也是wa。哪个大牛给几个关键数据测试下。我测试了n久都没发现错误~

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