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;
vector<int> edge[2001];
int deg[301], vis[301];
void dfs(int x) {
vis[x] = 1;
for (auto i : edge[x]) deg[i]--;
for (auto i : edge[x]) {
if (deg[i] == 0 && vis[i] == 0) {
Bridge(min(x, i), max(x, i));
dfs(i);
}
}
}
void Solve(int N) {
if (N > 300) assert(0);
for (int i = 1; i < N; ++i) {
edge[0].push_back(i);
for (int j = i + 1; j < N; ++j) {
int x = Query(0, i, j);
if (x != j) edge[x].push_back(j);
if (x != i) edge[x].push_back(i);
}
}
for (int i = 0; i < N; ++i) {
sort(edge[i].begin(), edge[i].end());
edge[i].erase(unique(edge[i].begin(), edge[i].end()), edge[i].end());
for (auto j : edge[i]) deg[j]++;
}
dfs(0);
}
# | 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... |