foo.cc: In function 'int step2()':
foo.cc:20:25: warning: integer overflow in expression [-Woverflow]
int ans = (1 << 31) - 1;
~~~~~~~~~~^~~
foo.cc: In function 'int main()':
foo.cc:41:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &n);
~~~~~^~~~~~~~~~
foo.cc:42:43: 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]);
~~~~~^~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务