primeprogrammer2021's blog

By primeprogrammer2021, 3 years ago, In English

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?

| Write comment?
»
3 years ago, # |
  Vote: I like it +1 Vote: I do not like it

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 years ago, # |
  Vote: I like it +19 Vote: I do not like it

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.