ARIF_30's blog

By ARIF_30, history, 5 months ago, In English

Hi everyone,

I solved a problem in the last contest and initially got a "Wrong Answer". After modifying my solution to use a map instead of a multiset, it got accepted. However, I’m not sure why my original solution with multiset failed.

Can anyone explain why using map worked while multiset didn't?

Thanks in advance for your help! https://codeforces.net/contest/1980/submission/264037860 (**WA**264037860) https://codeforces.net/contest/1980/submission/263990207 submission:263990207

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
5 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by ARIF_30 (previous revision, new revision, compare).

»
5 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

In a multiset, erasing elements by value is different from erasing it by iterator.

check this: link