Redirecting to
NADOS

Subtree Sum

.

https://cses.fi/problemset/task/1137/
Input Format
.
Output Format
.
Question Video
Constraints
.
Sample Input
5 3
4 2 5 2 1
1 2
1 3
3 4
3 5
2 3
1 5 3
2 3
Sample Output
8
10


  • Asked in Companies
  • Related Topics






Video Solution

Code Solution

Run
 
Run
Id Name