Comments
0
TestCase

Is C++17 faster than C++11 ?
The same solution gave TLE for problem D when submitted in C++11 and was accepted in C++17.
C++11 Submission
C++17 Submission

+4

Prefixes which have a length less than the length of the string

On cookiedothCodeforces Round #526, 8 years ago
0

But how to ensure that both the paths do not come from the same child?

you are not checking this case number of power of fives equal to zero. so for 5's 2's 64 0 6 32 0 5 16 0 4 8 0 3 3125 5 0 start your loop for number of power of fives from 0.