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

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

Hello Codeforces,

I was trying to solve Codeforces Round #632 (Div. 2) Problem C. It gave me TLE on the last case (87th case) when I used unordered_map (Link) while it was accepted when I used map (Link).

I know the worst-case time complexity of the unordered_map is O(n) for searching, insertion, and deletion. Is the last case the worst case? Could someone help me to figure out how this is happening or where I'm getting wrong?

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

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

    Thank you very much. And yes, your custom hash function is astounding.