weirdtree.cpp: In function 'void cut(int, int, int)':
weirdtree.cpp:16:27: error: 'v' was not declared in this scope
16 | pq.push(make_pair(v[i],-i));
| ^
weirdtree.cpp: At global scope:
weirdtree.cpp:25:5: error: 'v' does not name a type
25 | v[-pq.top().second]--;
| ^
weirdtree.cpp:27:2: error: 'pq' does not name a type
27 | pq.clear();
| ^~
weirdtree.cpp:28:1: error: expected declaration before '}' token
28 | }
| ^
weirdtree.cpp: In function 'void magic(int, int)':
weirdtree.cpp:30:2: error: 'v' was not declared in this scope
30 | v[i] = x;
| ^