You are viewing a single comment's thread. Return to all comments →
this works and not x1<10000 or x2<10000 , dont know why !
if(x1>x2 && v1>=v2) cout<<"NO"; else { for(;x1<100000000,x2<100000000;x1+=v1,x2+=v2) { //cout<<x1<<'-'<<x2<<endl; if(x1==x2){ f=1; break;} } if(f==1) cout<<"YES"; else cout<<"NO";
Number Line Jumps
You are viewing a single comment's thread. Return to all comments →
this works and not x1<10000 or x2<10000 , dont know why !