Блог пользователя coder_ISM

Автор coder_ISM, история, 4 часа назад, По-английски

Is it me or it happens with everyone that when you are using unordered map in hope that it will reduce your time complexity but in contrast it gives you TLE whereas if you use ordered map it gets accepted.

One thing I am aware of is that its generally not recommended to use auto for loops on unordered map but let me give you an example Question :- https://codeforces.net/contest/1971/problem/G Submission-1 :- https://codeforces.net/contest/1971/submission/287463963 Submission-2 :- https://codeforces.net/contest/1971/submission/287464168 The only difference in both submissions is that in previous one I am using unordered map and I am getting a TLE on TC 22 whereas the second one is getting submitted where I am using ordered map. Just to clarify I am not operating any auto loops on map you can even cross-check in my submissions.

Is this a technical glitch or is there any explanation behind this ? (If you know anything please comment below it will be really helpful :) )

  • Проголосовать: нравится
  • -13
  • Проголосовать: не нравится

»
4 часа назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

Read this

  • »
    »
    4 часа назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Thank you

»
4 часа назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Way to go vaibhav, I think you should start posting weekly updates on the questions that you solve and Provide Valuable perspective of yours and thought process. Orz.