game.cpp:10:7: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
main () {
^
game.cpp: In function 'int main()':
game.cpp:26:20: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
if (a[j-1]<idx && idx<a[j] ||
~~~~~~~~~~~^~~~~~~~~~~
game.cpp:11:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d",&n,&m);
~~~~~^~~~~~~~~~~~~~
game.cpp:14:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&a[i]);
~~~~~^~~~~~~~~~~~
game.cpp:17:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&type);
~~~~~^~~~~~~~~~~~
game.cpp:19:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d",&idx,&val);
~~~~~^~~~~~~~~~~~~~~~~~
game.cpp:23:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",&idx);
~~~~~^~~~~~~~~~~