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 |
高手帮优化一下,TLE#include<iostream> using namespace std; int main(){ long x,y,m,n,L,a; cin>>x>>y>>m>>n>>L; for(int i=0;;i++){ if(x==y){ cout<<i; break; } x=x+m; if(x>L) x=x%L; y=y+n; if(y>L) y=y%L; if(m==n){ cout<<"improssible"; break; } } return 0; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator