roadsideadverts.cpp:11:1: error: ISO C++ forbids declaration of 'dfs' with no type [-fpermissive]
11 | dfs(ll v,ll p,ll sum)
| ^~~
roadsideadverts.cpp: In function 'int dfs(int, int, int)':
roadsideadverts.cpp:24:1: warning: no return statement in function returning non-void [-Wreturn-type]
24 | }
| ^
roadsideadverts.cpp: In function 'int main()':
roadsideadverts.cpp:33:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
33 | scanf("%d",&n);
| ~~~~~^~~~~~~~~
roadsideadverts.cpp:37:11: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
37 | scanf("%d%d%d",&u,&v,&c);
| ~~~~~^~~~~~~~~~~~~~~~~~~
roadsideadverts.cpp:42:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
42 | scanf("%d",&q);
| ~~~~~^~~~~~~~~
roadsideadverts.cpp:45:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
45 | scanf("%d%d%d%d%d",&a1,&a2,&a3,&a4,&a5);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~