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 frkstyc at 2005-12-25 20:48:55 on Problem 1061
In Reply To:在ai上通过的程序为什么在acm上通不过 Posted by:yying at 2005-12-25 20:46:32
> 程序如下,帮忙看一下,谢谢了
> #include<stdio.h>
> void main(){
> 	int x,y,m,n,L;
> 	int a,b,t;
> 	scanf("%d %d %d %d %d",&x,&y,&m,&n,&L);
> 	for(t=0;;t++){
> 		a=(t*m+x)%L;
> 		b=(t*n+y)%L;
> 		if(m==n){printf("Impossible");break;}
> 		else if(a==b){printf("%d",t);break;}
> 	}
> }
> 

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