Lord_David's blog

By Lord_David, history, 5 weeks ago,

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

 » 5 weeks ago, # |   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)$.
•  » » 5 weeks ago, # ^ |   0 OMG THANK YOU SO MUCH!!!!!!!! <3 orz. I didn't think about that