Here I'm doing searching work only.unordered_map<>takes O(1) for searching and map<>takes O(long) for searching so I didn't get that why I'm getting tle. Here is my code link -:
https://codeforces.net/contest/1642/submission/147498144
Above is my tle code.
first learn how to ask questions in blogs
Auto comment: topic has been updated by rinku11 (previous revision, new revision, compare).
https://www.geeksforgeeks.org/unordered_map-in-cpp-stl/
Read that it mentioned that it can go up to o(n*n)
#define boost() reserve(1024)
#define fast() max_load_factor(0.25)
you can use this template (credit goes to Arpa) too to speed up umap in main :
umap_name.fast();
umap_name.boost();
Still it can give TLE on some specific case na
with ref to this blog -> https://codeforces.net/blog/entry/62393
Try this -> https://codeforces.net/blog/entry/62393
https://codeforces.net/contest/1642/submission/147545635
unordered_map is implemented using hash table because of hash collision it can take O(n) time in some cases