Please subscribe to the official Codeforces channel in Telegram via the link ×

Codechef Long Challenge problem DISTNUM3

Revision en2, by rhezo, 2017-02-19 18:13:38

How to solve this problem?

Statement: Given N nodes of a tree, answer Q queries of 2 types(update value of some node or find the number of distinct numbers on the path from U to V).

There is a solution with Mo's algorithm with updates and I don't understand that as well. Can anyone explain any other approach or even this one?


  Rev. Lang. By When Δ Comment
en2 English rhezo 2017-02-19 18:13:38 10
en1 English rhezo 2017-02-19 18:13:04 425 Initial revision (published)