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

测试对,为什么么会超时?1000000000 1888888888 147237 749234 1999999999结果也对

Posted by alpc0637 at 2008-02-06 12:25:25 on Problem 1061
#include<stdio.h>
int main()
{
	int x,y,m,n,l,i;
	scanf("%d%d%d%d%d",&x,&y,&m,&n,&l);
	i=0;
	if(x!=y&&m==n)
	{
		printf("Impossible");
		return 0;
	}
	while(x!=y)
	{
		x+=m;
		y+=n;
		while(x>l)
			x-=l;
		while(y>l)
			y-=l;
		i++;
	}
	printf("%d",i);
	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