Comments

When the next number is 1, you can just move there for free. If not you need to jump and pay. You can only do such jump once so what you want is to jump over all segments of zeros and get to some 1 from which you can just walk to the end of the array. Hope this makes sense. I was also confused by the problem statement.

For Div2C You can also do the following approach. Solve it for each color separately. Observer that you can calculate x and y parts of M distance separately. WTLOG for x coo: sort the x values and build the solution while processing x-coordinates one by one. If you know the distance needed for i-1 points you can use it to calculate the distance needed for the ith.

On strawhatdragon → Need help for 230A, 6 years ago
0

Read the problem statement again. Especially the part where they explain when the dragon is defeated and you should have it :)

Hello, thank you for kind suggestions. I'll try my best implementing it :D. I'm sorry for such a late reply. I've never written codeforces blog before so I missed your messages (my bad).

42.

And enjoying the present isn't bad either.