foo.cc: In function 'int solve(int)':
foo.cc:38:19: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
if(i & (1 << j - 1))
~~^~~
foo.cc: In function 'int main()':
foo.cc:57:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d", &n);
~~~~~^~~~~~~~~~
foo.cc:58:20: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
FOR(i, 1, n) scanf("%d", &a[i]);
~~~~~^~~~~~~~~~~~~
foo.cc:59:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d", &L, &R);
~~~~~^~~~~~~~~~~~~~~~~