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

Автор Kunal_Kashyap, история, 7 дней назад, По-английски

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

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

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

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

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

    yeah realized my mistake .thanks for help

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

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$$$