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:对于数据1000000000 1888888888 147237 749234 1999999999In Reply To:Re:对于数据1000000000 1888888888 147237 749234 1999999999 Posted by:rush at 2003-10-24 09:07:07 结果是对的吗? 这个数据的结果我也是这样的,但我提交的不被接受 #include <iostream.h> void main() { long int x,y,m,n,l,i; cin>>x>>y>>m>>n>>l; long int k,j=0; if(m>n){ k=y-x; for(i=0;i<=m-n;i++){ if(k>0){j+=k/(m-n);k=k%(m-n);} if(k==0){ cout<<j<<endl; break; } k=(l+k); } if(i>m-n)cout<<"Impossible"<<endl; } else{ k=x-y; for(i=0;i<=n-m;i++){ if(k>0){j+=k/(n-m);k=k%(n-m);} if(k==0){ cout<<j<<endl; break; } k=(l+k); } if(i>n-m)cout<<"Impossible"<<endl; } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator