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

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

Here is the problem this

And this is my solution this

According to my analysis, the solution should be O( q*log(m-n)+m ). So, with n<=10000, I am not able to find why I am getting TLE or where is the code going in infinite loop...

Any help would be appreciated.... Thanks in advance!!

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

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

Thanks guys!!! Got AC in my solution... Apparently, I was passing the vector into binary search function by value due to which copying took O(n) time in every query, leading to TLE.