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 "meetings.h"
#include <bits/stdc++.h>
using namespace std;
void Solve(int N) {
int sz[N] = {};
int o[N] = {};
vector<int> chil[N];
sz[0] = N;
for (int i = 1; i < N; i++) {
for (int j = 1; j < N; j++) {
if (i == j) continue;
if (Query(0, i, j) == i) {
sz[i]++;
chil[i].push_back(j);
}
}
o[i] = i;
}
sort(o, o + N, [&](int i, int j) { return sz[i] < sz[j]; });
bool us[N] = {};
for (int cur : o) {
for (int v : chil[cur]) {
if (us[v]) continue;
us[v] = true;
Bridge(cur, v);
}
}
for (int i = 1; i < N; i++) if (!us[i])
Bridge(0, i);
}
# | 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... |