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 1001. Reverse Root

TLE
Posted by B&B 1 May 2013 20:01
Why TLE on 1 test?
It takes no time on example. Any piece of advice?

#include <cstdio>
#include <vector>
#include <cmath>
using namespace std;

int main()
{
    vector<long long> n;
    long long a = 0;
    while( a != EOF)
    {
        scanf("%llu", &a);
        n.push_back(a);
    }
    for (int i = n.size() - 2; i >= 0; i--)
    {
        printf("%.4f\n", sqrt(long double(n.at(i))));
    }
    return 0;
}
Re: TLE
Posted by B&B 1 May 2013 20:05
Looks like I've caught it. It freezes if ctrl+d used for EOF and it's do not response if ctrl+z used, when -1 used everything is OK.

Edited by author 01.05.2013 20:12

Edited by author 01.05.2013 20:12