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

各位大虾帮帮忙,看我这到底哪里错啦……测试数据都用了是对的呀

Posted by wuziyi2010 at 2010-06-13 15:48:57 on Problem 1061
#include<stdio.h>
#include<iostream>
using namespace std;
int main()
{
	unsigned long x,y,m,n,L;
	scanf("%d%d%d%d%d",&x,&y,&m,&n,&L);
	unsigned long s;
	for(s=1;s<2000000000;s++)
	{
		x=(x+m)%L;
		y=(y+n)%L;
		if(x==y)
		{
			printf("%d\n",s);
			exit(1);
		}
	}
	printf("Impossible\n");
	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