#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(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);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
372 KB |
Output is correct |
2 |
Incorrect |
2 ms |
376 KB |
Wrong Answer [3] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
372 KB |
Output is correct |
2 |
Incorrect |
2 ms |
376 KB |
Wrong Answer [3] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
372 KB |
Output is correct |
2 |
Incorrect |
2 ms |
376 KB |
Wrong Answer [3] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
4 ms |
1016 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Halted |
0 ms |
0 KB |
- |