Блог пользователя strange_voice

Автор strange_voice, 9 лет назад, По-английски

Hi everybody.

I have a question. I tried to solve the problem A.123-sequence but each time it got "Time Limit exceeded on test 18". even I submitted the answer of one of my friends (ATofighi) that got "Accepted" to see that does the compiler do right? but it got "Time limit exceeded on test 18", too!!!!now I add the link of all the submissions below.

http://mirror.codeforces.com/contest/52/submission/12923012

http://mirror.codeforces.com/contest/52/submission/12923040

http://mirror.codeforces.com/contest/52/submission/12923066

http://mirror.codeforces.com/contest/52/submission/12923078

http://mirror.codeforces.com/contest/52/submission/12923091

http://mirror.codeforces.com/contest/52/submission/12923108

and these links are the links of my friend and my submissions(my friend got "Accepted" and when I submitted the same code it get "Time limit exceeded on test 18")

http://mirror.codeforces.com/contest/52/submission/4798391 "Accepted"

http://mirror.codeforces.com/contest/52/submission/12923117 "Time limit exceeded on test 18"

http://mirror.codeforces.com/contest/52/submission/4798427 "Accepted"

http://mirror.codeforces.com/contest/52/submission/12923121 "Time limit exceeded on test 18"

http://mirror.codeforces.com/contest/52/submission/4798425 "Accepted"

http://mirror.codeforces.com/contest/52/submission/12923130 "Time limit exceeded on test 18"

Thank you so much for your help.

UPD:Thank slycelote so much for his/her help .finally I get "Accepted".

http://mirror.codeforces.com/contest/52/submission/12957204

UPD2:If you have same problems I suggest that see this post too.It can be helpful for you.

http://mirror.codeforces.com/blog/entry/20262

  • Проголосовать: нравится
  • +4
  • Проголосовать: не нравится

»
9 лет назад, # |
Rev. 2   Проголосовать: нравится +8 Проголосовать: не нравится

Codeforces servers were upgraded some time between 2013 and now. Running time for old programs is calculated in this way to account for faster servers:

Package for this problem was not updated by the problem writer or Codeforces administration after we’ve upgraded the judging servers. To adjust the time limit constraint, solution execution time will be multiplied by 2. For example, if your solution works for 400 ms on judging servers, than value 800 ms will be displayed and used to determine the verdict.

But it's obviously not a precise method, and also compilers have been upgraded since then. So old programs may change from AC to TL or vice versa.

As for why you get a TL — probably because of inefficient I/O. Use this:

    ios_base::sync_with_stdio(0);
    cin.tie(0);
  • »
    »
    9 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Your right but if you see the runnig time of my friend's code, it's 592 ms and if you multiply it by 2 it get 1184 ms but my running time is 2000 ms and I get "time limit" . Why does it happen?? How do you think?