foo.cc: In function 'int query(int, int)':
foo.cc:78:30: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
if (tx > cnt || tx == cnt && a[i] < cur) {
~~~~~~~~~~^~~~~~~~~~~~~
foo.cc: In function 'int main()':
foo.cc:89:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d", &n, &q);
~~~~~^~~~~~~~~~~~~~~~
foo.cc:90:50: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
for (int i = 1; i <= n; i ++) scanf("%d", &a[i]), san[i] = a[i];
~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
foo.cc:100:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d", &l, &r);
~~~~~^~~~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务