foo.cc: In member function 'void tree::build(int, int, int)':
foo.cc:18:28: error: no match for 'operator=' (operand types are 'tree::node' and '<brace-enclosed initializer list>')
18 | nd[p] = {L, R, 1, 1};
| ^
foo.cc:11:12: note: candidate: 'tree::node& tree::node::operator=(const tree::node&)'
11 | struct node {
| ^~~~
foo.cc:11:12: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const tree::node&'
foo.cc:11:12: note: candidate: 'tree::node& tree::node::operator=(tree::node&&)'
foo.cc:11:12: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'tree::node&&'
foo.cc:21:21: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
21 | int mid = L + R >> 1;
| ~~^~~
foo.cc: In member function 'void tree::modify(int, int, int, int)':
foo.cc:31:27: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
31 | int mid = nd[p].L + nd[p].R >> 1;
| ~~~~~~~~^~~~~~~~~
foo.cc: In member function 'void tree::query(int, int)':
foo.cc:45:27: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
45 | int mid = nd[p].L + nd[p].R >> 1;
| ~~~~~~~~^~~~~~~~~
foo.cc: In member function 'void tree::changeTree(int, int)':
foo.cc:60:27: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
60 | int mid = nd[p].L + nd[p].R >> 1;
| ~~~~~~~~^~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务