tree.cpp: In function 'int main()':
tree.cpp:44: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:45: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:48: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:49: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]);
~~~~~^~~~~~~~~~~~~~~~~~~