Editorial for New Year's '18 P1 - Happy New Year!


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: Kirito

We can convert h and m into seconds and add them to s. The number of seconds the task takes is s \bmod 60 and the number of minutes \left\lfloor \dfrac s {60} \right\rfloor \bmod 60, and the number of hours is \left\lfloor \dfrac s {3600} \right\rfloor \bmod 12. Then, subtract that from 12:00:00 to get the answer. Note that the hours output should be between 0 and 11.

Time Complexity: \mathcal O(1)


Comments

There are no comments at the moment.