# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
362716 | sean617 | Connecting Supertrees (IOI20_supertrees) | C++17 | 277 ms | 23324 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 "supertrees.h"
#include <vector>
#define N 1005
using namespace std;
int n, cnt, bu[N], num[N];
bool v[N], v2[N], co[N][N];
vector<int> gu[N], cy[N], cy2, ans, ch[N];
vector<std::vector<int> > answer;
int f(int p) {
if (bu[p] == p) return p;
else return bu[p] = f(bu[p]);
}
void f_co(int p, int q) {
co[p][q] = co[q][p] = 1;
}
int ex(int p, int q) {
if (num[p] == 1 || num[q] == 1) return 2;
if (v2[p] && v2[q]) return 2;
if (v2[p] || v2[q]) return 1;
if (num[p] == num[q]) return 1;
return 2;
}
int construct(std::vector<std::vector<int> > p) {
int i, j, k, t, t1, t2, t3, la;
n = p.size();
for (i = 0; i < n; i++) bu[i] = i;
for (i = 0; i < n; i++) {
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |