# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
599449 | CaroLinda | Keys (IOI21_keys) | C++17 | 12 ms | 14420 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 <vector>
#include <bits/stdc++.h>
const int MAXN = 3e5+10;
using namespace std;
vector<int> filaChave[MAXN];
int N;
int dsu[MAXN];
vector<pair<int,int> > adj[MAXN];
bool chave[MAXN]; //assume sempre que estah limpa
bool vis[MAXN];
int find(int x){
return dsu[x] = (x == dsu[x]) ? x : find(dsu[x]);
}
bool join(int a, int b){
a = find(a);
b = find(b);
if(a == b)
return false;
if(rand() % 2)
swap(a,b);
dsu[a] = b;
Compilation message (stderr)
# | 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... |