Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

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

Автор swapno7064, история, 4 года назад, По-английски

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??

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

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

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.