balancedtree.cpp: In function 'void DFS(int, int, int, int, std::vector<int>&, std::vector<int>&, std::vector<int>&, std::vector<std::vector<int> >&, std::vector<std::vector<int> >&)':
balancedtree.cpp:14:5: error: 'deg' was not declared in this scope
14 | deg[i]--;
| ^~~
balancedtree.cpp:17:39: error: invalid initialization of reference of type 'std::vector<int>&' from expression of type 'std::vector<std::vector<int> >'
17 | DFS(i, now, 1, dp1[now]+1, c, path, p2);
| ^~~~
balancedtree.cpp:8:77: note: in passing argument 6 of 'void DFS(int, int, int, int, std::vector<int>&, std::vector<int>&, std::vector<int>&, std::vector<std::vector<int> >&, std::vector<std::vector<int> >&)'
8 | void DFS(int now, int par, int d0, int d1, vector <int> &dp0, vector <int> &dp1, vector <int> &c, vector<vector<int>> &path, vector<vector<int>> &p2) {
| ~~~~~~~~~~~~~~^~~
balancedtree.cpp:19:39: error: invalid initialization of reference of type 'std::vector<int>&' from expression of type 'std::vector<std::vector<int> >'
19 | DFS(i, now, dp0[now]+1, 1, c, path, p2);
| ^~~~
balancedtree.cpp:8:77: note: in passing argument 6 of 'void DFS(int, int, int, int, std::vector<int>&, std::vector<int>&, std::vector<int>&, std::vector<std::vector<int> >&, std::vector<std::vector<int> >&)'
8 | void DFS(int now, int par, int d0, int d1, vector <int> &dp0, vector <int> &dp1, vector <int> &c, vector<vector<int>> &path, vector<vector<int>> &p2) {
| ~~~~~~~~~~~~~~^~~
balancedtree.cpp: At global scope:
balancedtree.cpp:24:82: error: ISO C++ forbids declaration of 'dfs' with no type [-fpermissive]
24 | dfs(int now, int par, vector<int> &dp0, vector<int> &dp1, vector<vector<int>> &p2) {
| ^
balancedtree.cpp: In function 'int dfs(int, int, std::vector<int>&, std::vector<int>&, std::vector<std::vector<int> >&)':
balancedtree.cpp:30:1: warning: no return statement in function returning non-void [-Wreturn-type]
30 | }
| ^