|
|
back to boardDiscussion of Problem 1113. JeepHELP!!! Time limit exceeded 0.531sec PLZ HELP!!! why? #include<iostream> using namespace std; int main() { int a,m,n; double d,o,w; cin>>n>>m; a=0; w=0; o=0; bool q=true; while(q){ a++; d=m/(a << 1-1); if (w+d>=n){ q=false; } w=w+d; o=o+m; }
d=n-w; o=o+d*(a << 1-1); cout<<(abs(o+0.49999999999)); return 0; } Edited by author 21.06.2014 02:18 Edited by author 21.06.2014 02:18 Edited by author 21.06.2014 21:29 No subject Edited by author 21.06.2014 21:27 |
|
|