제출 #884656

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
8846562023-12-07 21:58:28TAhmed33Stranded Far From Home (BOI22_island)C++98
100 / 100
865 ms54596 KiB
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int MAXN = 2e5 + 25;
bool ok[MAXN];
set <int> pp;
int cnt[MAXN];
vector <pair <int, int>> edges;
int par[MAXN], sum[MAXN];
set <int> comp[MAXN];
set <pair <int, int>> valid;
void init () {
for (int i = 1; i < MAXN; i++) {
par[i] = i;
ok[i] = 1;
sum[i] = cnt[i];
comp[i].insert(i);
valid.insert({sum[i], i});
}
}
int find (int x) {
return par[x] == x ? x : par[x] = find(par[x]);
}
void merge (int x, int y) {
x = find(x);
y = find(y);
if (x == y) return;
if ((int)comp[x].size() > (int)comp[y].size()) swap(x, y);
valid.erase({sum[x], x});
valid.erase({sum[y], y});
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...