foo.cc: In function 'void clear_all()':
foo.cc:28:54: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
28 | for(int i=0;i<=ctt;i++){clear(v[i]);lf[i]=line[i]=siz[i]=0;}
| ~~~~~~~^~~~~~~~~
foo.cc: In function 'void dfs1(int)':
foo.cc:35:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
35 | for(int i=0;i<v[x].size();i++)
| ~^~~~~~~~~~~~
foo.cc: In function 'int main()':
foo.cc:61:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
61 | {scanf("%d",&T);for(int z=1;z<=T;z++){solve();clear_all();}return 0;}//拜拜程序~
| ~~~~~^~~~~~~~~
foo.cc: In function 'void solve()':
foo.cc:46:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
46 | scanf("%d%d",&n,&k);ctt=n;
| ~~~~~^~~~~~~~~~~~~~
foo.cc:47:32: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
47 | for(int i=1;i<=n;i++){scanf("%d%d%d",&fa[i],&a[i],&w[i]);lf[fa[i]]=true;}
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务