prog.cpp: In function ‘void upd(int, int, int, int)’:
prog.cpp:3:2: error: ‘tree’ was not declared in this scope
tree[node] = (r - l + 1) * val;
^~~~
prog.cpp:4:2: error: ‘lazy’ was not declared in this scope
lazy[node] = val;
^~~~
prog.cpp: In function ‘void propagate(int, int, int)’:
prog.cpp:9:6: error: ‘lazy’ was not declared in this scope
if (lazy[node] == -1) return;
^~~~
prog.cpp:11:21: error: ‘lazy’ was not declared in this scope
upd(node * 2,l,mid,lazy[node]);
^~~~
prog.cpp: In function ‘void rangeUpdate(int, int, int, int, int, int)’:
prog.cpp:21:12: error: ‘l’ was not declared in this scope
upd(node,l,r,val);
^
prog.cpp:21:14: error: ‘r’ was not declared in this scope
upd(node,l,r,val);
^
prog.cpp:28:2: error: ‘tree’ was not declared in this scope
tree[node] = tree[node * 2] + tree[node * 2 + 1];
^~~~
prog.cpp: In function ‘int rangeQuery(int, int, int, int, int, int)’:
prog.cpp:33:22: error: return-statement with no value, in function returning ‘int’ [-fpermissive]
if (queryL > nodeR) return;
^~~~~~
prog.cpp:34:49: error: ‘tree’ was not declared in this scope
if (queryL <= nodeL && nodeR <= queryR) return tree[node];
^~~~
prog.cpp:37:52: error: too few arguments to function ‘int rangeQuery(int, int, int, int, int, int)’
return rangeQuery(node * 2,nodeL,mid,queryL,queryR) + rangeQuery(node * 2 + 1,mid + 1,nodeR,queryL,queryR);
^
prog.cpp:31:5: note: declared here
int rangeQuery(int node,int nodeL,int nodeR,int queryL,int queryR,int val)
^~~~~~~~~~
prog.cpp:37:107: error: too few arguments to function ‘int rangeQuery(int, int, int, int, int, int)’
return rangeQuery(node * 2,nodeL,mid,queryL,queryR) + rangeQuery(node * 2 + 1,mid + 1,nodeR,queryL,queryR);
^
prog.cpp:31:5: note: declared here
int rangeQuery(int node,int nodeL,int nodeR,int queryL,int queryR,int val)
^~~~~~~~~~