ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1113. Jeep

HELP!!! Time limit exceeded 0.531sec
Posted by Chukharev 20 Jun 2014 21:33
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
Posted by Chukharev 21 Jun 2014 02:27


Edited by author 21.06.2014 21:27