RP_9's blog

By RP_9, history, 5 years ago, In English

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?

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

»
5 years ago, # |
  Vote: I like it +16 Vote: I do not like it
  • »
    »
    5 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

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