in this problem when I used an unordered map I got TLE and used the same solution with map I got ACC I need an explanation, please
- solution with unordered map https://codeforces.me/contest/1790/submission/191038498
- solution with map https://codeforces.me/contest/1790/submission/191038420
I really appreciate any help you can provide.








Because Unordered map(HashTable) has worst case time complexity of O(n^2). That happens in case of collisions and since there was hacking available. Hackers added anti-hash tests so it got the unordered map to have O(n^2) and thus TL
Map(Self Balancing BST) always O(log n)
Thank you my bro
You should read this.