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

Автор StlenHandle, история, 7 лет назад, По-английски

Hello Codeforces !

I can't do this problem. So I copy solution. And I submitted code with some changes, But it get TLE. I submit code without any changes, It get AC. And I delete only commentes in first submission.

First subm.

Second sumb.

And one question. Why?

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

»
7 лет назад, # |
  Проголосовать: нравится +28 Проголосовать: не нравится

It is not a magic . Submission time varies often a few ms .. Your second solution too just got lucky and had time of 2995 ms for a time limit of 3000ms and just passed .. .. If you try again submitting same code ,you may get TLE again

»
7 лет назад, # |
  Проголосовать: нравится +6 Проголосовать: не нравится

Look at the execution time of the second submission! 2995ms => this submission only barely got accepted.

A program will not execute with the same speed each time you call it. The execution time depends on a lot of variables, like the current load of the machine, the current clock frequency, current RAM/ROM usage, ...