catdog.cpp:104:13: error: expected unqualified-id before 'return'
104 | return rez;
| ^~~~~~
catdog.cpp:105:10: error: expected ';' after struct definition
105 | }
| ^
| ;
catdog.cpp: In member function 'Tree::Mat Tree::Mat::operator+(const Tree::Mat&) const':
catdog.cpp:102:13: warning: no return statement in function returning non-void [-Wreturn-type]
102 | }
| ^
catdog.cpp: At global scope:
catdog.cpp:108:10: error: 'Mat' was not declared in this scope; did you mean 'Tree::Mat'?
108 | AINT<Mat> aint;
| ^~~
| Tree::Mat
catdog.cpp:89:12: note: 'Tree::Mat' declared here
89 | struct Mat {
| ^~~
catdog.cpp:108:13: error: template argument 1 is invalid
108 | AINT<Mat> aint;
| ^
catdog.cpp:121:5: error: 'Mat' does not name a type; did you mean 'cat'?
121 | Mat red(int node) {
| ^~~
| cat
catdog.cpp:127:5: error: 'Mat' does not name a type; did you mean 'cat'?
127 | Mat blue(int node) {
| ^~~
| cat
catdog.cpp:133:5: error: 'Mat' does not name a type; did you mean 'cat'?
133 | Mat gol(int node) {
| ^~~
| cat
catdog.cpp: In function 'void init(int, int)':
catdog.cpp:141:14: error: request for member 'upd' in 'aint', which is of non-class type 'int'
141 | aint.upd(nodepoz(node), gol(node));
| ^~~
catdog.cpp:141:18: error: 'nodepoz' was not declared in this scope; did you mean 'Tree::nodepoz'?
141 | aint.upd(nodepoz(node), gol(node));
| ^~~~~~~
| Tree::nodepoz
catdog.cpp:55:9: note: 'Tree::nodepoz' declared here
55 | int nodepoz(int node) { return pin[node];}
| ^~~~~~~
catdog.cpp:141:33: error: 'gol' was not declared in this scope
141 | aint.upd(nodepoz(node), gol(node));
| ^~~
catdog.cpp:142:22: error: 'g' was not declared in this scope; did you mean 'Tree::g'?
142 | for(auto x : g[node])
| ^
| Tree::g
catdog.cpp:49:17: note: 'Tree::g' declared here
49 | vector<int> g[nmax];
| ^
catdog.cpp: In function 'void init(int)':
catdog.cpp:149:9: error: 'Mat' was not declared in this scope; did you mean 'Tree::Mat'?
149 | Mat ok;
| ^~~
| Tree::Mat
catdog.cpp:89:12: note: 'Tree::Mat' declared here
89 | struct Mat {
| ^~~
catdog.cpp:150:9: error: 'ok' was not declared in this scope
150 | ok.mat[0][0] = 0;
| ^~
catdog.cpp:152:14: error: request for member 'init' in 'aint', which is of non-class type 'int'
152 | aint.init(n, ok);
| ^~~~
catdog.cpp: In function 'int upd(int)':
catdog.cpp:157:22: error: 'pch' was not declared in this scope; did you mean 'Tree::pch'?
157 | int father = pch[node];
| ^~~
| Tree::pch
catdog.cpp:52:9: note: 'Tree::pch' declared here
52 | int pch[nmax], lastpoz[nmax], p[nmax];
| ^~~
catdog.cpp:158:14: error: request for member 'upd' in 'aint', which is of non-class type 'int'
158 | aint.upd(nodepoz(node), color[node] == 0? gol(node) : color[node] == 1? red(node) : blue(node));
| ^~~
catdog.cpp:158:18: error: 'nodepoz' was not declared in this scope; did you mean 'Tree::nodepoz'?
158 | aint.upd(nodepoz(node), color[node] == 0? gol(node) : color[node] == 1? red(node) : blue(node));
| ^~~~~~~
| Tree::nodepoz
catdog.cpp:55:9: note: 'Tree::nodepoz' declared here
55 | int nodepoz(int node) { return pin[node];}
| ^~~~~~~
catdog.cpp:158:51: error: 'gol' was not declared in this scope
158 | aint.upd(nodepoz(node), color[node] == 0? gol(node) : color[node] == 1? red(node) : blue(node));
| ^~~
catdog.cpp:158:81: error: 'red' was not declared in this scope
158 | aint.upd(nodepoz(node), color[node] == 0? gol(node) : color[node] == 1? red(node) : blue(node));
| ^~~
catdog.cpp:158:93: error: 'blue' was not declared in this scope
158 | aint.upd(nodepoz(node), color[node] == 0? gol(node) : color[node] == 1? red(node) : blue(node));
| ^~~~
catdog.cpp:160:41: error: request for member 'query' in 'aint', which is of non-class type 'int'
160 | if(father == 0) { auto R = aint.query(pin[father], lastpoz[father]); return min({R.mat[0][0],R.mat[0][1],R.mat[1][0],R.mat[1][1]});}
| ^~~~~
catdog.cpp:160:47: error: 'pin' was not declared in this scope; did you mean 'Tree::pin'?
160 | if(father == 0) { auto R = aint.query(pin[father], lastpoz[father]); return min({R.mat[0][0],R.mat[0][1],R.mat[1][0],R.mat[1][1]});}
| ^~~
| Tree::pin
catdog.cpp:53:9: note: 'Tree::pin' declared here
53 | int pin[nmax], pout[nmax], inp = 1;
| ^~~
catdog.cpp:160:60: error: 'lastpoz' was not declared in this scope; did you mean 'Tree::lastpoz'?
160 | if(father == 0) { auto R = aint.query(pin[father], lastpoz[father]); return min({R.mat[0][0],R.mat[0][1],R.mat[1][0],R.mat[1][1]});}
| ^~~~~~~
| Tree::lastpoz
catdog.cpp:52:20: note: 'Tree::lastpoz' declared here
52 | int pch[nmax], lastpoz[nmax], p[nmax];
| ^~~~~~~
catdog.cpp:160:138: error: no matching function for call to 'min(<brace-enclosed initializer list>)'
160 | if(father == 0) { auto R = aint.query(pin[father], lastpoz[father]); return min({R.mat[0][0],R.mat[0][1],R.mat[1][0],R.mat[1][1]});}
| ^
In file included from /usr/include/c++/10/vector:60,
from catdog.h:3,
from catdog.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:230:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
230 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/10/bits/stl_algobase.h:230:5: note: template argument deduction/substitution failed:
catdog.cpp:160:138: note: candidate expects 2 arguments, 1 provided
160 | if(father == 0) { auto R = aint.query(pin[father], lastpoz[father]); return min({R.mat[0][0],R.mat[0][1],R.mat[1][0],R.mat[1][1]});}
| ^
In file included from /usr/include/c++/10/vector:60,
from catdog.h:3,
from catdog.cpp:1:
/usr/include/c++/10/bits/stl_algobase.h:278:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
278 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/10/bits/stl_algobase.h:278:5: note: template argument deduction/substitution failed:
catdog.cpp:160:138: note: candidate expects 3 arguments, 1 provided
160 | if(father == 0) { auto R = aint.query(pin[father], lastpoz[father]); return min({R.mat[0][0],R.mat[0][1],R.mat[1][0],R.mat[1][1]});}
| ^
In file included from /usr/include/c++/10/algorithm:62,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
from catdog.cpp:2:
/usr/include/c++/10/bits/stl_algo.h:3468:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(std::initializer_list<_Tp>)'
3468 | min(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/10/bits/stl_algo.h:3468:5: note: template argument deduction/substitution failed:
/usr/include/c++/10/bits/stl_algo.h:3474:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(std::initializer_list<_Tp>, _Compare)'
3474 | min(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/10/bits/stl_algo.h:3474:5: note: template argument deduction/substitution failed:
catdog.cpp:162:17: error: 'p' was not declared in this scope; did you mean 'Tree::p'?
162 | overson[p[father]] -= mine[father];
| ^
| Tree::p
catdog.cpp:52:35: note: 'Tree::p' declared here
52 | int pch[nmax], lastpoz[nmax], p[nmax];
| ^
catdog.cpp:163:23: error: request for member 'query' in 'aint', which is of non-class type 'int'
163 | auto R = aint.query(pin[father], lastpoz[father]);
| ^~~~~
catdog.cpp:163:29: error: 'pin' was not declared in this scope; did you mean 'Tree::pin'?
163 | auto R = aint.query(pin[father], lastpoz[father]);
| ^~~
| Tree::pin
catdog.cpp:53:9: note: 'Tree::pin' declared here
53 | int pin[nmax], pout[nmax], inp = 1;
| ^~~
catdog.cpp:163:42: error: 'lastpoz' was not declared in this scope; did you mean 'Tree::lastpoz'?
163 | auto R = aint.query(pin[father], lastpoz[father]);
| ^~~~~~~
| Tree::lastpoz
catdog.cpp:52:20: note: 'Tree::lastpoz' declared here
52 | int pch[nmax], lastpoz[nmax], p[nmax];
| ^~~~~~~
catdog.cpp: At global scope:
catdog.cpp:172:1: error: expected declaration before '}' token
172 | }
| ^
catdog.cpp: In function 'void initialize(int, std::vector<int>, std::vector<int>)':
catdog.cpp:181:16: warning: statement has no effect [-Wunused-value]
181 | Tree::pch[0];
| ~~~~~~~~~~~^
catdog.cpp:184:11: error: 'init' is not a member of 'Tree'; did you mean 'Init'?
184 | Tree::init(n);
| ^~~~
| Init
catdog.cpp: In function 'int cat(int)':
catdog.cpp:190:11: error: 'color' is not a member of 'Tree'; did you mean 'color'?
190 | Tree::color[--v] = 1;
| ^~~~~
catdog.cpp:119:9: note: 'color' declared here
119 | int color[nmax];
| ^~~~~
catdog.cpp:191:16: error: 'upd' is not a member of 'Tree'; did you mean 'upd'?
191 | return Tree::upd(v);
| ^~~
catdog.cpp:156:9: note: 'upd' declared here
156 | int upd(int node) {
| ^~~
catdog.cpp: In function 'int dog(int)':
catdog.cpp:195:11: error: 'color' is not a member of 'Tree'; did you mean 'color'?
195 | Tree::color[--v] = 2;
| ^~~~~
catdog.cpp:119:9: note: 'color' declared here
119 | int color[nmax];
| ^~~~~
catdog.cpp:196:16: error: 'upd' is not a member of 'Tree'; did you mean 'upd'?
196 | return Tree::upd(v);
| ^~~
catdog.cpp:156:9: note: 'upd' declared here
156 | int upd(int node) {
| ^~~
catdog.cpp: In function 'int neighbor(int)':
catdog.cpp:200:11: error: 'color' is not a member of 'Tree'; did you mean 'color'?
200 | Tree::color[--v] = 0;
| ^~~~~
catdog.cpp:119:9: note: 'color' declared here
119 | int color[nmax];
| ^~~~~
catdog.cpp:201:16: error: 'upd' is not a member of 'Tree'; did you mean 'upd'?
201 | return Tree::upd(v);
| ^~~
catdog.cpp:156:9: note: 'upd' declared here
156 | int upd(int node) {
| ^~~