foo.cc: In function 'void init(int)':
foo.cc:36:44: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
if (tmp[a[j]] > cnt || tmp[a[j]] == cnt && a[j] < cur) {
~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
foo.cc: In function 'int query(int, int)':
foo.cc:58:32: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
if (tmp > cnt || tmp == cnt && a[i] < cur) {
~~~~~~~~~~~^~~~~~~~~~~~~
foo.cc:65:32: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
if (tmp > cnt || tmp == cnt && a[i] < cur) {
~~~~~~~~~~~^~~~~~~~~~~~~
foo.cc:73:32: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
if (tmp > cnt || tmp == cnt && a[i] < cur) {
~~~~~~~~~~~^~~~~~~~~~~~~
foo.cc: In function 'int main()':
foo.cc:84: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:85: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:95: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)提供评测服务