tree.cpp: In function 'int main()':
tree.cpp:43:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d",&n,&q);
~~~~~^~~~~~~~~~~~~~~
tree.cpp:44:36: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
for(int i=2 ; i<=n ; i++) scanf("%d",&p[i]);
~~~~~^~~~~~~~~~~~
tree.cpp:47:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d",&query[i][0],&query[i][1]);
~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tree.cpp:48:30: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
if(query[i][0]) scanf("%d",&query[i][2]);
~~~~~^~~~~~~~~~~~~~~~~~~