tree.cpp: In function 'void DFS(int)':
tree.cpp:34:13: error: 'P' was not declared in this scope
34 | if(x == P[v]) continue;
| ^
tree.cpp:41:31: error: 'W' was not declared in this scope
41 | C[v] = l, res += C[v]*abs(W[v]);
| ^
tree.cpp:45:19: error: 'W' was not declared in this scope
45 | us[v].insert({W[v],(ll)2e6}), su_us[v] += (ll)2e6;
| ^
tree.cpp:45:17: error: no matching function for call to 'std::multiset<Element>::insert(<brace-enclosed initializer list>)'
45 | us[v].insert({W[v],(ll)2e6}), su_us[v] += (ll)2e6;
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/11/set:62,
from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:87,
from tree.cpp:1:
/usr/include/c++/11/bits/stl_multiset.h:551:9: note: candidate: 'template<class _InputIterator> void std::multiset<_Key, _Compare, _Alloc>::insert(_InputIterator, _InputIterator) [with _InputIterator = _InputIterator; _Key = Element; _Compare = std::less<Element>; _Alloc = std::allocator<Element>]'
551 | insert(_InputIterator __first, _InputIterator __last)
| ^~~~~~
/usr/include/c++/11/bits/stl_multiset.h:551:9: note: template argument deduction/substitution failed:
tree.cpp:45:17: note: candidate expects 2 arguments, 1 provided
45 | us[v].insert({W[v],(ll)2e6}), su_us[v] += (ll)2e6;
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/11/set:62,
from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:87,
from tree.cpp:1:
/usr/include/c++/11/bits/stl_multiset.h:502:7: note: candidate: 'std::multiset<_Key, _Compare, _Alloc>::iterator std::multiset<_Key, _Compare, _Alloc>::insert(const value_type&) [with _Key = Element; _Compare = std::less<Element>; _Alloc = std::allocator<Element>; std::multiset<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree<Element, Element, std::_Identity<Element>, std::less<Element>, std::allocator<Element> >::const_iterator; std::multiset<_Key, _Compare, _Alloc>::value_type = Element]'
502 | insert(const value_type& __x)
| ^~~~~~
/usr/include/c++/11/bits/stl_multiset.h:502:32: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type&' {aka 'const Element&'}
502 | insert(const value_type& __x)
| ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/11/bits/stl_multiset.h:507:7: note: candidate: 'std::multiset<_Key, _Compare, _Alloc>::iterator std::multiset<_Key, _Compare, _Alloc>::insert(std::multiset<_Key, _Compare, _Alloc>::value_type&&) [with _Key = Element; _Compare = std::less<Element>; _Alloc = std::allocator<Element>; std::multiset<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree<Element, Element, std::_Identity<Element>, std::less<Element>, std::allocator<Element> >::const_iterator; std::multiset<_Key, _Compare, _Alloc>::value_type = Element]'
507 | insert(value_type&& __x)
| ^~~~~~
/usr/include/c++/11/bits/stl_multiset.h:507:27: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::multiset<Element>::value_type&&' {aka 'Element&&'}
507 | insert(value_type&& __x)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/11/bits/stl_multiset.h:532:7: note: candidate: 'std::multiset<_Key, _Compare, _Alloc>::iterator std::multiset<_Key, _Compare, _Alloc>::insert(std::multiset<_Key, _Compare, _Alloc>::const_iterator, const value_type&) [with _Key = Element; _Compare = std::less<Element>; _Alloc = std::allocator<Element>; std::multiset<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree<Element, Element, std::_Identity<Element>, std::less<Element>, std::allocator<Element> >::const_iterator; std::multiset<_Key, _Compare, _Alloc>::const_iterator = std::_Rb_tree<Element, Element, std::_Identity<Element>, std::less<Element>, std::allocator<Element> >::const_iterator; std::multiset<_Key, _Compare, _Alloc>::value_type = Element]'
532 | insert(const_iterator __position, const value_type& __x)
| ^~~~~~
/usr/include/c++/11/bits/stl_multiset.h:532:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/11/bits/stl_multiset.h:537:7: note: candidate: 'std::multiset<_Key, _Compare, _Alloc>::iterator std::multiset<_Key, _Compare, _Alloc>::insert(std::multiset<_Key, _Compare, _Alloc>::const_iterator, std::multiset<_Key, _Compare, _Alloc>::value_type&&) [with _Key = Element; _Compare = std::less<Element>; _Alloc = std::allocator<Element>; std::multiset<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree<Element, Element, std::_Identity<Element>, std::less<Element>, std::allocator<Element> >::const_iterator; std::multiset<_Key, _Compare, _Alloc>::const_iterator = std::_Rb_tree<Element, Element, std::_Identity<Element>, std::less<Element>, std::allocator<Element> >::const_iterator; std::multiset<_Key, _Compare, _Alloc>::value_type = Element]'
537 | insert(const_iterator __position, value_type&& __x)
| ^~~~~~
/usr/include/c++/11/bits/stl_multiset.h:537:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/11/bits/stl_multiset.h:563:7: note: candidate: 'void std::multiset<_Key, _Compare, _Alloc>::insert(std::initializer_list<_Tp>) [with _Key = Element; _Compare = std::less<Element>; _Alloc = std::allocator<Element>]'
563 | insert(initializer_list<value_type> __l)
| ^~~~~~
/usr/include/c++/11/bits/stl_multiset.h:563:43: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::initializer_list<Element>'
563 | insert(initializer_list<value_type> __l)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/11/bits/stl_multiset.h:583:7: note: candidate: 'std::multiset<_Key, _Compare, _Alloc>::iterator std::multiset<_Key, _Compare, _Alloc>::insert(std::multiset<_Key, _Compare, _Alloc>::node_type&&) [with _Key = Element; _Compare = std::less<Element>; _Alloc = std::allocator<Element>; std::multiset<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree<Element, Element, std::_Identity<Element>, std::less<Element>, std::allocator<Element> >::const_iterator; std::multiset<_Key, _Compare, _Alloc>::node_type = std::_Rb_tree<Element, Element, std::_Identity<Element>, std::less<Element>, std::allocator<Element> >::node_type]'
583 | insert(node_type&& __nh)
| ^~~~~~
/usr/include/c++/11/bits/stl_multiset.h:583:26: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::multiset<Element>::node_type&&' {aka 'std::_Rb_tree<Element, Element, std::_Identity<Element>, std::less<Element>, std::allocator<Element> >::node_type&&'}
583 | insert(node_type&& __nh)
| ~~~~~~~~~~~~^~~~
/usr/include/c++/11/bits/stl_multiset.h:588:7: note: candidate: 'std::multiset<_Key, _Compare, _Alloc>::iterator std::multiset<_Key, _Compare, _Alloc>::insert(std::multiset<_Key, _Compare, _Alloc>::const_iterator, std::multiset<_Key, _Compare, _Alloc>::node_type&&) [with _Key = Element; _Compare = std::less<Element>; _Alloc = std::allocator<Element>; std::multiset<_Key, _Compare, _Alloc>::iterator = std::_Rb_tree<Element, Element, std::_Identity<Element>, std::less<Element>, std::allocator<Element> >::const_iterator; std::multiset<_Key, _Compare, _Alloc>::const_iterator = std::_Rb_tree<Element, Element, std::_Identity<Element>, std::less<Element>, std::allocator<Element> >::const_iterator; std::multiset<_Key, _Compare, _Alloc>::node_type = std::_Rb_tree<Element, Element, std::_Identity<Element>, std::less<Element>, std::allocator<Element> >::node_type]'
588 | insert(const_iterator __hint, node_type&& __nh)
| ^~~~~~
/usr/include/c++/11/bits/stl_multiset.h:588:7: note: candidate expects 2 arguments, 1 provided