Subtree Sum with Point Updates
Support two operations on a tree rooted at 1: U v x sets the value of node v to x; Q v prints the sum of the subtree of v.
Constraints
1 <= n, q <= 10^5
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.