Vatsal38's blog

By Vatsal38, history, 7 years ago, In English

solution link: https://ideone.com/Dn2nQN problem link : https://codeforces.me/problemset/problem/1234/B2 Why it is giving tle at 23rd case?

  • Vote: I like it
  • +3
  • Vote: I do not like it

»
7 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Most likely it is because you are using an unordered map. Some tests are made specifically to mess with that container. Try using a map instead.

»
7 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

If you want more information on unordered_map and how to make it faster: https://codeforces.me/blog/entry/62393

»
7 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Unordered map can have a high complexity when it is used a lot of times.