| ||||||||||
| 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 | |||||||||
为什么总是超时,有没有别的测试数据?哪位C++高手指点一下,谢谢#include<iostream.h>
int main()
{
int x,y,m,n,l,i;
cin>>x>>y>>m>>n>>l;
i=0;
if(x!=y&&m==n)
{
cout<<"Impossible";
return 0;
}
while(x!=y)
{
x+=m;
y+=n;
while(x>l)
x-=l;
while(y>l)
y-=l;
i++;
}
cout<<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