When submitting a solution in C++, please select either C++14 (GCC 6-32) or C++17 (GCC 7-32) as your compiler. ×

primeprogrammer2021's blog

By primeprogrammer2021, 22 months 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

| Write comment?
»
22 months 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.

»
22 months 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.

»
10 months ago, # |
Rev. 2   Vote: I like it -18 Vote: I do not like it

my code TLE with GNU C++17 And ACC with GNU C++20(64)