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.
Submitting an official solution before solving the problem yourself is a bannable offence.
Author:
Notice that the average brightness increases with an increase in . Thus, we can binary search for the that would make the average brightness equal to . The maximum value can take is (when all pixel brightnesses are ).
Time Complexity:
Comments