In competitive programming, some judges create adversarial test cases that cause many hash collisions, degrading to . Signs of a hash attack: TLE on unordered_map but AC on map. Solutions:
Use tree-based structures (map in C++, TreeMap in Java). is slower but guaranteed.
Use a custom hash function that's harder to attack.
In Python, dict is generally resistant but not immune.