foo.cc: In function 'int build(int, int)':
foo.cc:18:17: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
int mid = l + r >> 1;
~~^~~
foo.cc: In function 'int update(int, int, int, int)':
foo.cc:29:17: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
int mid = l + r >> 1;
~~^~~
foo.cc: In function 'int query(int, int, int, int, int)':
foo.cc:38:17: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
int mid = l + r >> 1,x = sum[ls[v]] - sum[ls[u]];//通过区间减法得到左儿子的信息
~~^~~
foo.cc: In function 'void init()':
foo.cc:48:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d",&n,&m);
~~~~~^~~~~~~~~~~~~~
foo.cc:50:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d",a + i);
~~~~~^~~~~~~~~~~~
foo.cc: In function 'void work()':
foo.cc:63:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d%d",&l,&r,&k);
~~~~~^~~~~~~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务