Codeforces и Polygon могут быть недоступны в период с 23 мая, 7:00 (МСК) по 23 мая, 11:00 (МСК) в связи с проведением технических работ. ×
Изменения рейтингов за последние раунды временно удалены. Скоро они будут возвращены. ×

Codechef Long Challenge problem DISTNUM3

Правка en1, от rhezo, 2017-02-19 18:13:04

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. Язык Кто Когда Δ Комментарий
en2 Английский rhezo 2017-02-19 18:13:38 10
en1 Английский rhezo 2017-02-19 18:13:04 425 Initial revision (published)