swapno7064's blog

By swapno7064, history, 4 years ago, In English

107595954 in GNU C++17 (TLE) in contest i submitted this solution and it got AC and after system testin g it got TLE. 107660655 in MS C++ 2017 (AC) 107661331 in GNU C++14 (TLE)

Both code are exactly same. Can anyone Explain Why this happened??

  • Vote: I like it
  • +18
  • Vote: I do not like it

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

your unordered_map got an anti-hash test(unordered_map worst case look time O(n) due to all hashes colliding with each other). And because MS C++ 2017 is a different compiler, so unordered map hashing works a bit different. In whatever way, the three should get timelimit anyways. I recommend you not to use unordered_map in hackable contests or in sites that have system testing afterwards like codeforces.