Комментарии
На danya.smelskiyCurrent CPU on Codeforces, 2 года назад
-8

Спасибо!

На MorphyCC May Long Challenge 2020, 4 года назад
+80

I prefer Taster

На Golovanov399Tree queries for O(nq), 5 лет назад
+5

Yep, tests where tree is a bamboo must be so close for maximum test for this solution, and the last subtask also contains this tests.

На Golovanov399Tree queries for O(nq), 5 лет назад
0

Wow, thanks. It's really cool trick. I tried to cut off solutions with bad time complexity (what is hard when main complexity is $$$O(n\sqrt{n}$$$ $$$log n)$$$), but I didn't expect this.

На Golovanov399Tree queries for O(nq), 5 лет назад
0

Excuse me, I didn't understand why your solution is faster than $$$O(nm)$$$. Do you visit all vertices on simple path for each query?

My solution used this technique with $$$O(\sqrt{n})$$$ for update and $$$O(\sqrt{n}$$$ $$$log$$$ $$$n)$$$ to get answer.

+16

But you are from MIT