# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
572575 | model_code | Stranded Far From Home (BOI22_island) | C++17 | 350 ms | 40452 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int fnd(int u, vector<int> &p){ // performs path compression
if(p[u] < 0) return u;
return p[u] = fnd(p[u], p);
}
void mrg(int u, int v, vector<int> &p, vector<long long> &strength){
u = fnd(u,p), v = fnd(v,p);
if(u==v) return;
if(p[u] > p[v]) swap(u,v); // performs size optimization
p[u] += p[v];
p[v] = u;
strength[u] += strength[v];
}
void dfs(int u, int flag, vector<int> &canwin, vector<vector<int>> &mark){
canwin[u] &= flag;
for(int v : mark[u]) dfs(v, canwin[u], canwin, mark);
}
int main(){
cin.tie(0);
ios::sync_with_stdio(0);
int N, M;
cin >> N >> M;
vector<int> s(N);
for(int &x : s) cin >> x;
# | 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... |