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 |
Re:高手帮优化一下,TLEIn Reply To:高手帮优化一下,TLE Posted by:xuhk at 2008-10-13 18:54:26 > #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; > > } 跪求高手解决TLE啊……!@¥!@#¥!@#¥!234 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator