dsu/UF_list.hpp
- View this file on GitHub
- Last update: 2020-10-21 08:20:00+09:00
- Include:
#include "dsu/UF_list.hpp"
Code
class UF{
public:
vector<int> data;
int sz;
public:
UF(int sz):sz(sz){
for(int i=0;i<sz;++i)data[i]=i;
}
bool unite(int x,int y){
data.swap(x,y);
return 1;
}
};
#line 1 "dsu/UF_list.hpp"
class UF{
public:
vector<int> data;
int sz;
public:
UF(int sz):sz(sz){
for(int i=0;i<sz;++i)data[i]=i;
}
bool unite(int x,int y){
data.swap(x,y);
return 1;
}
};