TCS_Bhediya's blog

By TCS_Bhediya, history, 2 hours ago, In English

My solution, which uses unordered map got hacked : 287746456.
But when I changed the unordered_map to map it got accepted : 287859015. Can anybody tell the reason?

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

»
2 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

i think this blog can help https://codeforces.net/blog/entry/62393

  • »
    »
    2 hours ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Thank you, that helps. Should I use map instead of unordered_map everywhere (unless I get TLE)?

    • »
      »
      »
      2 hours ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      I'd say especially on CF, use an unordered_map with custom hashing since you don't know how bad the constant factor on a map could be, and you could potentially FST using a map in certain cases if the samples are weak.

»
8 minutes ago, # |
  Vote: I like it 0 Vote: I do not like it

LOL , qmk hacked me with a similar concept T_T