← All problemsSign in

Graph Sum

Given a Tree T where each vertex v has a weight w, you need to support the following queries:- 0 v m Add the number m, K times to the vertex v . Here K denotes the last 5 digits of L where L is the number of ways you can make m by using the numbers 2 and 4. Eg. for a query 0 1 6, you need to add 6, 3 times to the vertex 1. Which means you will add 18 to the weight of vertex 1. This is because 6 =

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start