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

Автор Lord_David, история, 3 года назад, По-английски

Hello everyone, I've spent a lot of time trying to solve this problem 1574C - Slay the Dragon, I've even read the editorial and tried implementing it myself, but every time it's too slow no matter what I try. So could someone please explain why this solution is too slow. Thanks in advance! 129796109

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

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

You should pass your vector to a function by reference (like this: vl &nums), otherwise you'll be creating an independent copy of it, making your code work in $$$O(n \cdot m)$$$.