ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1521. War Games 2

You can simulate in with segment tree
Posted by Mahilewets 1 Jul 2017 20:50
In your segment tree you have count of zeros on every segment of vector of length N.
Find k-th non-zero element.  Then zero it.  Update tree.  Output.