Problem segmenttree
User Huoi
Submission Time 2026-03-11 08:59:52
Score 0
Max Time N/A
Max Memory N/A

Compile Error

segmenttree.cpp: In function ‘void build()’:
segmenttree.cpp:19:18: error: ‘n’ was not declared in this scope
19 | for (int i = n - 1; i > 0; i--) {
| ^
segmenttree.cpp: In function ‘void update(long long int, S)’:
segmenttree.cpp:25:17: error: ‘n’ was not declared in this scope
25 | for (t[p += n] = val; p > 1; p >>= 1) {
| ^
segmenttree.cpp: In function ‘S query(long long int, long long int)’:
segmenttree.cpp:32:15: error: ‘n’ was not declared in this scope
32 | for (l += n, r += n; l < r; l >>= 1, r >>= 1) {
| ^
segmenttree.cpp: In function ‘void solve()’:
segmenttree.cpp:40:12: error: ‘n’ was not declared in this scope
40 | cin >> n >> q;
| ^
segmenttree.cpp:40:17: error: ‘q’ was not declared in this scope
40 | cin >> n >> q;
| ^