# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
710930 | emptypringlescan | Stranded Far From Home (BOI22_island) | C++17 | 266 ms | 70180 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define int long long
int par[200005];
long long men[200005];
vector<int> sz[200005];
int find(int x){
if(par[x]==x) return x;
return par[x]=find(par[x]);
}
void merge(int x, int y){
x=find(x); y=find(y);
assert(x<200005&&y<200005);
if(sz[x].size()<=sz[y].size()){
for(int i:sz[x]) sz[y].push_back(i);
sz[x].clear();
}
else{
for(int i:sz[y]) sz[x].push_back(i);
swap(sz[x],sz[y]);
sz[x].clear();
}
men[y]+=men[x];
men[x]=0;
par[x]=y;
}
int32_t main(){
ios::sync_with_stdio(0);
cin.tie(0);
for(int i=0; i<200005; i++) par[i]=i;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |