unordered_map gives TLE? UMAP vs MAP

Revision en1, by abhinavawasthi, 2022-02-24 09:33:51

Yesterday, I have participated in codeforces round 773.

Was able to solve the first three questions during the contest, but my B and C submission got TLE on System Cases, do you know why? Just because I have used unordered_map instead of map.

I think, this is practical example to examine the diff btw unordered_map and map.

The same code with the same logic gives TLE, when using UMAP but got accepted, when using MAP.

1642B - Power Walking Submission with UMAP: submission:147440230

1642C - Great Sequence Submission with UMAP: submission:147426920

1642B - Power Walking Submission with MAP: submission:147497381

1642C - Great Sequence Submission with MAP: submission:147497320

One of my codeforces friends also told me about this, with a very good resource attached, you can check it.

Any suggestions are welcomed!

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English abhinavawasthi 2022-02-24 09:33:51 1128 Initial revision (published)