# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
736574 | horiseun | Parachute rings (IOI12_rings) | C++17 | 4042 ms | 71944 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 <iostream>
#include <vector>
#include <tuple>
#include <algorithm>
using namespace std;
#define f first
#define s second
int n, cycsz;
bool nne;
vector<int> adj[1000005];
vector<pair<int, int>> edges;
struct UnionFind1 {
int rt, par[1000005], deg[1000005];
bool vld;
int find(int x) {
return par[x] == x ? x : par[x] = find(par[x]);
}
void merge(int x, int y) {
if (!vld || x == rt || y == rt) return;
int px = find(x), py = find(y);
if (deg[x] == 2 || deg[y] == 2 || px == py) {
vld = false;
return;
}
deg[x]++;
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... |