Problem decayedbridges
User dzuizz
Submission Time 2025-09-16 10:07:52
Score 0
Max Time N/A
Max Memory N/A

Compile Error

decayedbridges.cpp:5:3: error: ‘vector’ does not name a type
5 | vector<int> pa,sz;
| ^~~~~~
decayedbridges.cpp: In function ‘void dsu::init(int)’:
decayedbridges.cpp:8:5: error: ‘pa’ was not declared in this scope
8 | pa.resize(n);
| ^~
decayedbridges.cpp:10:5: error: ‘sz’ was not declared in this scope
10 | sz.resize(n,1);
| ^~
decayedbridges.cpp: In function ‘int dsu::f(int)’:
decayedbridges.cpp:12:27: error: ‘pa’ was not declared in this scope
12 | int f(int x){ return x==pa[x]?x:pa[x]=f(pa[x]); }
| ^~
decayedbridges.cpp: In function ‘int dsu::m(int, int)’:
decayedbridges.cpp:16:13: error: ‘sz’ was not declared in this scope
16 | int res=sz[a]*sz[b];
| ^~
decayedbridges.cpp:17:5: error: ‘pa’ was not declared in this scope; did you mean ‘a’?
17 | pa[b]=a,sz[a]+=sz[b];
| ^~
| a