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

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

I was trying to solve problem. In this problem, the constraint for weight is not given. So i assumed it to be less than 1000000 and solved it accordingly. Here is my code. But it is giving RE. I have wasted a whole day to rectify it but i couldn't. Please someone help me. EDIT: I used set in place of array to store weight. So, there should not be any case of overflow.But still getting RE with code.

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

»
7 лет назад, # |
Rev. 2   Проголосовать: нравится +13 Проголосовать: не нравится

Probably weights are  ≤ 109 , you can use unordered_map, but you will get TLE with that. https://ideone.com/jY2HeC

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

    I used set ss in place of conr . array cone should not be changed since it will store max. value of 80000. But this code is also giving RE.

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

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