Editorial for Wesley's Anger Contest 3 Problem 2 - Eat, Sleep, Code, Repeat
Submitting an official solution before solving the problem yourself is a bannable offence.
Author:
Subtask 1
For subtask 1, one can loop through all possible integer value of hours from
Time Complexity:
Subtask 2
For subtask 2, one can loop through all pairs of hours from
Time Complexity:
Subtask 3
For subtask 3, one can loop through
Given an integer
, find two nonnegative integers and such that and the product of and is maximized.
This value is maximized when the absolute difference between
Careful steps must be taken to ensure that the three variables must sum up to
Time Complexity:
Subtask 4
For the full solution, we can apply the same idea and extend it to
Time Complexity:
Comments