Editorial for DMOPC '18 Contest 5 P2 - A Photography Problem


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.

Author: AvaLovelace

Notice that the average brightness increases with an increase in C. Thus, we can binary search for the C that would make the average brightness equal to 0.48. The maximum value C can take is 480 (when all pixel brightnesses are 10^{-3}).

Time Complexity: \mathcal O(NM \log C)


Comments

There are no comments at the moment.