I'm just in a funny mood. Don't take this post too seriously.
These are all of the problems I've solved using unordered_map
. This should be a complete list. For context, I've solved maybe around 4000 problems in total?
- 1120C - Compress String
- Logistics from Estonian Open 2016
I think neither solution is intended. The moral of the story: this class (and unordered_set
) are very rarely if ever necessary in competitive programming. Yes, in theory they can do in $$$O(1)$$$ what map
does in $$$O(\log n)$$$. In practice, they have a pretty large constant and are maybe only marginally faster than map
. And that's not to mention all the times you can get hacked on it.