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

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

I am facing a really weird fast execution time on Codeforces on submission 75468775. On test #6, the code runs for 1153 ms on Codeforces servers, but when I run it on my own computer, it takes me 5682 ms to run! Yes there is difference on hardware of course, but it runs about 5 times faster on Codeforces! I am wondering if there is any optimization on Codeforces servers or compile instructions which makes it run as fast as this?

UPD: That is actually because of -O2 compile flag. Never knew it affects the running time as much as making it run 5 times faster.

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

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

I guess the reason is compiler flag to optimize code.

Possible Reason

Maybe I am wrong. But let us find out the answer.

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Yes, Yes. You are right. Actually this is because of -O2 flag. I didn't know this flag is effective like this! I should have probably tested running the code with Codeforces compile flags before posting the blog.

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

Auto comment: topic has been updated by amiralisalimi (previous revision, new revision, compare).