Editorial for DMOPC '16 Contest 2 P4 - Zeros
Submitting an official solution before solving the problem yourself is a bannable offence.
Author:
Knowledge required: number theory, binary search
First of all, it is important to recognize the relationship between
To solve for the 50% subtask, we can simply brute-force the value of
Time Complexity:
To solve for the rest of the cases, it is important to recognize that the number of trailing zeros of
- The minimum
such that has at least trailing zeros. - The maximum
such that does not have more than trailing zeros.
The number of valid values of
Time Complexity:
Comments