제출 #599501

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
5995012022-07-19 14:41:24SlavicGStranded Far From Home (BOI22_island)C++17
100 / 100
456 ms60664 KiB
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
const int N = 2e5 + 10;
ll cnt[N], p[N], c[N];
set<ll> s[N];
vector<ll> adj[N], g[N];
ll get(ll a) {return p[a] = (p[a] == a ? a : get(p[a]));}
ll val[N];
void uni(ll a, ll b, ll vb) {
a = get(a), b = get(b);
if(a == b) return;
if(cnt[a] < vb) {
val[a] = 0;
}
p[a] = b;
cnt[b] += cnt[a];
g[b].push_back(a);
}
int ans[N];
void dfs(int u, int cur) {
cur &= val[u];
ans[u] = cur;
for(int v: g[u]) {
dfs(v, cur);
}
}
int main() {
int n, m; cin >> n >> m;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...