vrintle's blog

By vrintle, 3 years ago, In English

Hello everyone!

The following is my submission to Problem F1 — Guess the K-th Zero (Easy version)

118290089

It is showing me TLE, whereas when I run it locally, it passes the test case. I have also cross-checked my loops, but found nothing suspicious. I guess my logic is a bit different from others, but I will later work on that, firstly I want to know the reason for TLE.

  • Vote: I like it
  • -3
  • Vote: I do not like it

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Remove the line

cout << n << ' ' << t << ' ' << k;

which you apparently used for debugging.

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Ah, I overlooked it completely. Thanks a lot, man!

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it
fflush(stdout) or cout.flush() in C ++;

Have you tried flushing the output buffer? It says in the problem statement that you may receive an Idleness Limit Exceeded (or TLE I guess) if you do not

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Yes, I have used endl for that, but I had forgot to comment a debug line.