candies.cpp:3:1: error: 'vector' does not name a type
3 | vector<array<int,2> > seg(2000001);
| ^~~~~~
candies.cpp:4:1: error: 'vector' does not name a type
4 | vector<bool> segtrue(2000001);
| ^~~~~~
candies.cpp:5:1: error: 'vector' does not name a type
5 | vector<array<int,2> > li;
| ^~~~~~
candies.cpp:6:1: error: 'vector' does not name a type
6 | vector<int> flag(200001);
| ^~~~~~
candies.cpp: In function 'void build(int, int, int)':
candies.cpp:9:9: error: 'seg' was not declared in this scope
9 | seg[v]=li[tl];
| ^~~
candies.cpp:9:16: error: 'li' was not declared in this scope
9 | seg[v]=li[tl];
| ^~
candies.cpp:10:9: error: 'segtrue' was not declared in this scope
10 | segtrue[v]=1;
| ^~~~~~~
candies.cpp: In function 'void push_flag(int)':
candies.cpp:18:8: error: 'flag' was not declared in this scope
18 | if(flag[v]!=0){
| ^~~~
candies.cpp:19:12: error: 'segtrue' was not declared in this scope
19 | if(segtrue[v*2]){
| ^~~~~~~
candies.cpp:21:17: error: 'seg' was not declared in this scope
21 | seg[v*2][0]=min(seg[v*2][0]+flag[v],seg[v*2][1]);
| ^~~
candies.cpp:21:29: error: 'min' was not declared in this scope; did you mean 'std::min'?
21 | seg[v*2][0]=min(seg[v*2][0]+flag[v],seg[v*2][1]);
| ^~~
| std::min
In file included from /usr/include/c++/10/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from candies.cpp:2:
/usr/include/c++/10/bits/stl_algo.h:3474:5: note: 'std::min' declared here
3474 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
candies.cpp:23:17: error: 'seg' was not declared in this scope
23 | seg[v*2][0]=max(seg[v*2][0]+flag[v],0);
| ^~~
candies.cpp:23:29: error: 'max' was not declared in this scope; did you mean 'std::max'?
23 | seg[v*2][0]=max(seg[v*2][0]+flag[v],0);
| ^~~
| std::max
In file included from /usr/include/c++/10/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from candies.cpp:2:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: 'std::max' declared here
3486 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
candies.cpp:29:12: error: 'segtrue' was not declared in this scope
29 | if(segtrue[v*2+1]){
| ^~~~~~~
candies.cpp:31:17: error: 'seg' was not declared in this scope
31 | seg[v*2+1][0]=min(seg[v*2+1][0]+flag[v],seg[v*2+1][1]);
| ^~~
candies.cpp:31:31: error: 'min' was not declared in this scope; did you mean 'std::min'?
31 | seg[v*2+1][0]=min(seg[v*2+1][0]+flag[v],seg[v*2+1][1]);
| ^~~
| std::min
In file included from /usr/include/c++/10/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from candies.cpp:2:
/usr/include/c++/10/bits/stl_algo.h:3474:5: note: 'std::min' declared here
3474 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
candies.cpp:33:17: error: 'seg' was not declared in this scope
33 | seg[v*2+1][0]=max(seg[v*2+1][0]+flag[v],0);
| ^~~
candies.cpp:33:31: error: 'max' was not declared in this scope; did you mean 'std::max'?
33 | seg[v*2+1][0]=max(seg[v*2+1][0]+flag[v],0);
| ^~~
| std::max
In file included from /usr/include/c++/10/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from candies.cpp:2:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: 'std::max' declared here
3486 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
candies.cpp: In function 'void update(int, int, int, int, int, int)':
candies.cpp:43:5: error: 'pushflag' was not declared in this scope; did you mean 'push_flag'?
43 | pushflag(v);
| ^~~~~~~~
| push_flag
candies.cpp:45:9: error: 'flag' was not declared in this scope
45 | flag[v]=x;
| ^~~~
candies.cpp: In function 'int query(int, int, int, int)':
candies.cpp:51:16: error: 'seg' was not declared in this scope
51 | return seg[v];
| ^~~
candies.cpp: In function 'std::vector<int> distribute_candies(std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
candies.cpp:65:9: error: 'li' was not declared in this scope; did you mean 'i'?
65 | li.push_back({0,c[i]});
| ^~
| i
candies.cpp:67:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
67 | for(int i=0;i<l.size();i++){
| ~^~~~~~~~~
candies.cpp:70:5: error: 'vector' was not declared in this scope
70 | vector<int> ans;
| ^~~~~~
candies.cpp:70:5: note: suggested alternatives:
In file included from /usr/include/c++/10/vector:67,
from candies.h:1,
from candies.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:389:11: note: 'std::vector'
389 | class vector : protected _Vector_base<_Tp, _Alloc>
| ^~~~~~
In file included from candies.h:1,
from candies.cpp:1:
/usr/include/c++/10/vector:86:13: note: 'std::pmr::vector'
86 | using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
| ^~~~~~
candies.cpp:70:12: error: expected primary-expression before 'int'
70 | vector<int> ans;
| ^~~
candies.cpp:72:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
72 | ans.push_back(query(1,0,n-1,i));
| ^~~
| abs
candies.cpp:74:12: error: 'ans' was not declared in this scope; did you mean 'abs'?
74 | return ans;
| ^~~
| abs