| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
测试对,为什么么会超时?1000000000 1888888888 147237 749234 1999999999结果也对#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator