ballmachine.cpp: In function 'int dfs1(int)':
ballmachine.cpp:20:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=0;i<v[node].size();i++)
~^~~~~~~~~~~~~~~
ballmachine.cpp: In function 'void dfs2(int)':
ballmachine.cpp:44:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=0;i<v[node].size();i++)
~^~~~~~~~~~~~~~~
ballmachine.cpp: In function 'int main()':
ballmachine.cpp:58:13: warning: unused variable 'b' [-Wunused-variable]
{ int n,q,a,b,i,x,root;
^
ballmachine.cpp:59:6: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d",&n,&q);
~~~~~^~~~~~~~~~~~~~
ballmachine.cpp:62:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&a);
~~~~~^~~~~~~~~
ballmachine.cpp:86:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&x);
~~~~~^~~~~~~~~
ballmachine.cpp:92:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&k);
~~~~~^~~~~~~~~
ballmachine.cpp:116:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&k);
~~~~~^~~~~~~~~
ballmachine.cpp: In function 'int dfs1(int)':
ballmachine.cpp:18:39: warning: iteration 19 invokes undefined behavior [-Waggressive-loop-optimizations]
for(int i=1;i<=20;i++) up[node][i]=up[ up[node][i-1] ][i-1];
~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
ballmachine.cpp:18:18: note: within this loop
for(int i=1;i<=20;i++) up[node][i]=up[ up[node][i-1] ][i-1];
~^~~~
ballmachine.cpp: In function 'int main()':
ballmachine.cpp:82:5: warning: 'root' may be used uninitialized in this function [-Wmaybe-uninitialized]
dfs2(root);
~~~~^~~~~~