Editorial for Mock CCC '19 Contest 1 J3 - Liwi Sequence


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.

Submitting an official solution before solving the problem yourself is a bannable offence.

Authors: jsumabat

We can let c_x represent the number of occurrences of x in A. If c_x < x then we should add c_x to the answer. Otherwise, if c_x \ge x, we should add c_x - x to the answer.


Comments

There are no comments at the moment.