Please subscribe to the official Codeforces channel in Telegram via the link: https://t.me/codeforces_official. ×

_GOT's blog

By _GOT, history, 16 months ago, In English,

problem link: http://codeforces.com/contest/740/problem/D

I don't understand after performing binary lifting [determining for each node all the ancestors of distance 2^j that control it] how to calculate the answer for all the ancestors that control it not only who's distance at 2^j.

any clarification ?

thanks.

Read more »