Kunal_Kashyap's blog

By Kunal_Kashyap, history, 3 weeks ago, In English

D. In Love

in this problem i am using multiset<pair<int, int>> to store range l,r;but it gives WA on 253rd case .although when using separate multiset for both l and r it is accepted.i thought but could not come up with reason .can anyone help me with this .266946652

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

»
3 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

because you need to know the min and the max of l and h separately

»
3 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

You assume that s.begin()->second is the smallest $$$r$$$ in the multiset. That is not necessarely the case:

3
+ 1 10
+ 2 3
+ 9 11

In this configuration, you would print "NO" because $$$10 \ge 9$$$