| ||||||||||
| 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 | |||||||||
求助.好心人能指点迷津吗?
#include <iostream.h>
int main()
{
long x,y,m,n,l,i,s;
i=1;
cin>>x>>y>>m>>n>>l;
s=x-y;
while (x-y+i*(m-n)%l!=s)
{
i++;
if ((x+i*m)%l==(y+i*n)%l)
{
cout<<i;
break;
}
}
if (x-y+i*(m-n)%l==s) cout<<"Impossible"<<"\n";
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator