foo.cc: In function 'void Addedge(int, int, int)':
foo.cc:30:2: error: 'id' was not declared in this scope
id++;set[id].v=v;set[id].w=w;set[id].nx=head[u];
^~
foo.cc: In function 'void tree_dp1(int, int)':
foo.cc:37:25: error: 'intree' was not declared in this scope
if (set[k].v!=father&&intree[set[k].v])
^~~~~~
foo.cc:37:25: note: suggested alternative: 'index'
if (set[k].v!=father&&intree[set[k].v])
^~~~~~
index
foo.cc:40:13: error: 'fa' was not declared in this scope
son[u]++;fa[set[k].v]=1;
^~
foo.cc: In function 'void tree_dp2(int, int)':
foo.cc:48:7: error: 'k' was not declared in this scope
for (k=head[u];k>0;k=set[k].nx)
^
foo.cc:52:8: error: 'fa' was not declared in this scope
if (fa[u]+son[u]-1) up[set[k].v]+=(fa[u]*up[u]+down[u]*son[u]-down[set[k].v]-set[k].w)/(fa[u]+son[u]-1);
^~
foo.cc: In function 'void dfs1(int, int)':
foo.cc:62:7: error: expected primary-expression before ')' token
if ()
^
foo.cc:63:2: error: expected primary-expression before '}' token
}
^
foo.cc: In function 'void work()':
foo.cc:69:2: error: 'dfs2' was not declared in this scope
dfs2(1,1);
^~~~
foo.cc:69:2: note: suggested alternative: 'dfs1'
dfs2(1,1);
^~~~
dfs1
foo.cc: In function 'int main()':
foo.cc:78:31: error: 'w' was not declared in this scope
u=read<int>();v=read<int>();w=read<int>();
^
自豪的采用 HydroJudge 进行评测(github.com/hydro-dev/HydroJudge)