# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
576131 | SlavicG | Connecting Supertrees (IOI20_supertrees) | C++17 | 212 ms | 26344 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"
#include "supertrees.h"
using namespace std;
#define ll long long
#define sz(a) (int)a.size()
#define pb push_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define forn(i, n) for(int i=0;i < n; ++i)
const int N = 1005;
int par[N], ways[N][N];
bool vis[N];
bool ok = true;
int get(int a) {
return par[a] = (par[a] == a ? a : get(par[a]));
}
void uni(int a, int b) {
a = get(a);
b = get(b);
par[a] = b;
}
vector<int> adj[N];
void dfs(int u, int start) {
vis[u] = true;
if(++ways[start][u] >= 3 || !ok) {
ok = false;
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |