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

Автор primeprogrammer2021, 3 года назад, По-английски

I got TLE with GNU C++20 (64) : 158299729

And AC with GNU C++17 : 158299827

You can check that both the submissions are exactly same.

Also, I custom tested 158299729 and found out that it is taking 3 seconds.

Can anyone tell the main difference between these two versions?

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

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

Honestly, I don't know. I had the same issue the other day. My code got TLE with GNU C++17, and AC with GNU C++20.

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

Probably this test case 176 was made in such a way to trigger quadratic behavior in the C++20 implementation of unordered_map. Better just use a map, or learn about proper hashing.