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

Автор munmud, история, 4 года назад, По-английски

I was solving Div.1 264A . But I am getting TLE for that which I think I shouldn't get. After changing lang from GNU C++17 to GNU C++11, I got accecpted for that problem using same code. Is there any specific reason for that ?

Accecpted : GNU C++11 submission TLE : GNU C++17 submission

Thank you.

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

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

1)Running time can be different on different run.The AC-submission ran in 1981ms , which is very close to the 2000ms time limit.

2)Possibly doing flush operation in C++17 is slower than in C++11

flush operation is somewhat slow.endl will automatically do flush operation as well as creating a new line every time.

You can use \n instead of endl, the first one won't do flush operation for each time.