Editorial for WC '18 Contest 2 J2 - This Message will Self-Destruct


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.

Let m be the numerical value (0 \dots 9) of the first character of S. We can obtain this value by subtracting the ASCII value of 0 from the ASCII value of that character. Similarly, let s_1 and s_2 be the numerical values of the third and fourth characters, respectively. Then, m corresponds to minutes, s_1 to tens of seconds, and s_2 to single seconds. The total number of seconds therefore comes out to 60m+10s_1+s_2.


Comments

There are no comments at the moment.