Problem cowland
User haydendoo
Submission Time 2022-12-24 12:24:28
Score 0
Max Time N/A
Max Memory N/A

Compile Error

cowland.cpp: In function ‘void dfs_sz(int, int)’:
cowland.cpp:15:26: error: ‘it’ was not declared in this scope
15 | for(const auto &it: adj[it]) {
| ^~
cowland.cpp: In function ‘int main()’:
cowland.cpp:57:15: error: no matching function for call to ‘SegTree<int>::init(int)’
57 | root.init(n+2);
| ^
cowland.cpp:4:115: note: candidate: ‘void SegTree<T>::init(int, int*) [with T = int]’
4 | template<typename T> struct SegTree { const T ID = 0; T cmb(T a, T b) { return a^b; } int n; vector<T> seg; void init(int _n, int A[]) { for (n = 1; n < _n; ) n *= 2; seg.assign(2*n,ID); } void pull(int p) { seg[p] = cmb(seg[2*p],seg[2*p+1]); } void upd(int p, T val) { seg[p += n] = val; for (p /= 2; p; p /= 2) pull(p); } T query(int l, int r) { T ra = ID, rb = ID; for (l += n, r += n+1; l < r; l /= 2, r /= 2) { if (l&1) ra = cmb(ra,seg[l++]); if (r&1) rb = cmb(seg[--r],rb);