# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
60576 | aome | Parachute rings (IOI12_rings) | C++17 | 1126 ms | 77780 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;
const int N = 1000005;
int n, m;
int szCircle;
int deg[N];
int sz[N], par[N];
int G[N][3];
bool noSolution;
pair<int, int> E[N];
struct DSU {
int root;
int valid;
int par[N];
int deg[N];
int find(int u) { return u == par[u] ? u : par[u] = find(par[u]); }
void join(int u, int v) { par[find(u)] = find(v); }
void add(int u, int v) {
if (!valid || u == root || v == root) return;
int ru = find(u), rv = find(v);
if (deg[u] == 2 || deg[v] == 2 || ru == rv) {
valid = 0; return;
}
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... |