#include "meetings.h"
#include <bits/stdc++.h>
using namespace std;
int lca[2005][2005];
void dfs(int u, vector<int> possible){
for(int v: possible){
bool boleh = true;
for(int x: possible){
if(lca[v][x] == v || lca[v][x] == u){
}else{
boleh = false;
break;
}
}
if(boleh){
vector<int> possible2;
for(int x: possible){
if(lca[v][x] == v && v != x){
possible2.push_back(x);
}
}
Bridge(u, v);
dfs(v, possible2);
}
}
}
void Solve(int N) {
lca[0][0] = 0;
for(int i = 1; i < N; i ++){
lca[0][i] = 0;
lca[i][0] = 0;
}
for(int i = 1; i < N; i ++){
lca[i][i] = i;
for(int j = i+1; j < N; j ++){
lca[i][j] = Query(0, i, j);
lca[j][i] = lca[i][j];
}
}
vector<int> possible;
for(int i = 1; i < N; i ++){
possible.push_back(i);
}
dfs(0, possible);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
384 KB |
Output is correct |
2 |
Incorrect |
0 ms |
384 KB |
Wrong Answer [3] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
384 KB |
Output is correct |
2 |
Incorrect |
0 ms |
384 KB |
Wrong Answer [3] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
384 KB |
Output is correct |
2 |
Incorrect |
0 ms |
384 KB |
Wrong Answer [3] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
3098 ms |
9080 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |