Red Huang

Red Huang

Codeforces Round #187 (Div. 2) C. Sereja and Contest

The problem description is about a code server that has a formula for calculating rank.

image

If the calculated di is less than k, then the person should be deleted and recalculated.

Then, continue to find the numbers of all deleted people.

It can be observed that the formula is obtained by subtracting ai multiplied by (n-i) from the numbers before ai.

So if no one before the current point i is deleted, it can be guaranteed that the rank will not change in the future rounds.

If the person to be deleted is encountered, delete that point, increase the deletion count by 1, and the formula should have an additional i-del to represent the actual position.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.