Skip to main content

Practice · 3 of 3

Marked Nodes in a Subtree

CHALLENGE
Difficulty: advanced+25 XP

**Bài toán.** Rooted tree (root 1). q ops: TOG v toggles the mark on node v; CNT v prints the number of marked nodes in subtree(v). **Constraints:** 1 ≤ n, q ≤ 200 000. BIT over tin positions.

Back to lesson: Practice: Euler Query Trio