For POI’10-Frog question, the given solution, why size of cycles was calculated? Wouldn’t, binary lifting alone suffice, instead of (N \times 20, can’t we do N \times 64)?
I tried that. Storing that big of an array wouldn’t work: it will exceed the memory limit.