|
|
back to boardWA #17 !!!!!!!!! Posted by tqti 25 Oct 2013 00:05 #include<iostream> using namespace std; int main() { double p,q; cin>>p; cin.get(); cin>>q; long tmp_q = 1,tmp_p = 0; for(int i = 1;i < size_t(-1); ++i) { tmp_p = p * i * 100; tmp_q = q * i * 100; long res = (int)(tmp_p/10000); ++res; if(tmp_q % 10000 == 0) { if(res < (int)(tmp_q/10000)) { cout<<i<<endl; break; } } else { if(res <= (int)(tmp_q/10000)) { cout<<i<<endl; break; } } } } Re: WA #17 !!!!!!!!! Posted by tqti 25 Oct 2013 00:07 some hints?? where's the problem??? |
|
|