primeprogrammer2021's blog

By primeprogrammer2021, 6 weeks 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?

 
 
 
 
  • Vote: I like it
  • -9
  • Vote: I do not like it

»
6 weeks 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.

  • »
    »
    6 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Well that's understandable as they fixed some issues in older version.

    But in my case, the code is AC with older version and TLE with newer version, which I think shouldn't happen.

»
6 weeks 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.