#include <bits/stdc++.h>
#include "meetings.h"
using namespace std;
int lca[310][310];
int depth[310];
set<int> subtree[310];
void dfs(int u){
//cout << u << "hi\n";
for (auto it = subtree[u].begin(); it != subtree[u].end(); ++it){
int v = *it;
if (depth[v] == depth[u]+1){
//cout << u << " " << v << "hi\n";
Bridge(u,v);
dfs(v);
}
}
}
void Solve(int N) {
for (int i = 0; i < N; i++){
for (int j = 0; j < N; j++){
if (i == j) lca[i][j] = i;
else if (i == 0 || j == 0) lca[i][j] = 0;
else lca[i][j] = Query(0,i,j);
}
}
for (int i = 0; i < N; i++){
for (int j = 0; j < N; j++){
if (i == j) continue;
if (lca[i][j] == i){
depth[j]++;
subtree[i].insert(j);
}
}
}
dfs(0);
}
# |
결과 |
실행 시간 |
메모리 |
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 |
3066 ms |
1016 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |