street_lamps.cpp:12:12: error: 'maxn' was not declared in this scope
12 | bool state[maxn];
| ^~~~
street_lamps.cpp:22:9: error: 'maxn' was not declared in this scope
22 | } query[maxn];
| ^~~~
street_lamps.cpp: In function 'int main()':
street_lamps.cpp:37:17: error: 'state' was not declared in this scope; did you mean '_xstate'?
37 | state[i] = s[i] - '0';
| ^~~~~
| _xstate
street_lamps.cpp:46:55: error: 'i' was not declared in this scope
46 | if (last != -1) segment.insert(make_pair(last,i - 1));
| ^
street_lamps.cpp:49:42: error: 'query' was not declared in this scope
49 | string TMP;cin >> TMP >> query[i].a;
| ^~~~~
street_lamps.cpp:58:29: error: 'state' was not declared in this scope; did you mean '_xstate'?
58 | if (state[pos]) {
| ^~~~~
| _xstate
street_lamps.cpp:64:41: error: 'struct Fenwick2D' has no member named 'event'
64 | fenwick.event(l,pos,pos,r);
| ^~~~~
street_lamps.cpp:85:41: error: 'struct Fenwick2D' has no member named 'event'
85 | fenwick.event(l,pos,pos,r);
| ^~~~~
street_lamps.cpp:90:25: error: 'state' was not declared in this scope; did you mean '_xstate'?
90 | state[pos] ^= 1;
| ^~~~~
| _xstate
street_lamps.cpp:95:9: error: 'fen' was not declared in this scope
95 | fen.build();
| ^~~
street_lamps.cpp:101:17: error: 'state' was not declared in this scope; did you mean '_xstate'?
101 | state[i] = s[i] - '0';
| ^~~~~
| _xstate
street_lamps.cpp:111:55: error: 'i' was not declared in this scope
111 | if (last != -1) segment.insert(make_pair(last,i - 1));
| ^
street_lamps.cpp:115:21: error: 'query' was not declared in this scope
115 | if (query[i].op == 'q') {
| ^~~~~
street_lamps.cpp:117:41: error: 'struct Fenwick2D' has no member named 'get'
117 | cout << fenwick.get(query[i].a,query[i].b) << '\n';
| ^~~
street_lamps.cpp:122:29: error: 'state' was not declared in this scope; did you mean '_xstate'?
122 | if (state[pos]) {
| ^~~~~
| _xstate
street_lamps.cpp:128:41: error: 'struct Fenwick2D' has no member named 'update'
128 | fenwick.update(l,pos,pos,r,i);
| ^~~~~~
street_lamps.cpp:149:41: error: 'struct Fenwick2D' has no member named 'update'
149 | fenwick.update(l,pos,pos,r,-i);
| ^~~~~~
street_lamps.cpp:154:25: error: 'state' was not declared in this scope; did you mean '_xstate'?
154 | state[pos] ^= 1;
| ^~~~~
| _xstate
street_lamps.cpp:28:19: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
28 | freopen(thuhien".inp","r",stdin);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
street_lamps.cpp:29:19: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
29 | freopen(thuhien".out","w",stdout);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~