traffic.cpp: In function 'long long int dfs(int, int)':
traffic.cpp:12:18: error: 'edge' was not declared in this scope
for( int v : edge[u] ) if( v != p ) val[u] += dfs( v );
^~~~
traffic.cpp:12:58: error: too few arguments to function 'long long int dfs(int, int)'
for( int v : edge[u] ) if( v != p ) val[u] += dfs( v );
^
traffic.cpp:11:11: note: declared here
long long dfs( int u, int p ) {
^~~
traffic.cpp: In function 'int LocateCentre(int, int*, int*, int*)':
traffic.cpp:25:24: error: 'u' was not declared in this scope
for( int v : g[u] ) mx = max( mx, val[v] );
^