#include <bits/stdc++.h>
#include "meetings.h"
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
vector<int> adj[2020];
bool chk[2020];
void add(int u, int p, int w){
for (int &v : adj[u]){
if (v == p) continue;
int x = Query(u, v, w);
if (x == u) continue;
else if (x == v){
add(v, u, w);
return;
}
else{
chk[x] = true;
for (int &k : adj[v]) if (k == u) k = x;
v = x;
adj[x].push_back(u);
adj[x].push_back(v);
if (x != w){
adj[x].push_back(w);
adj[w].push_back(x);
}
return;
}
}
adj[u].push_back(w);
adj[w].push_back(u);
}
void Solve(int N) {
for (int i=1; i<N; i++){
if (chk[i]) continue;
add(0, -1, i);
}
for (int u=0; u<N; u++) for (int v : adj[u]) if (u < v) Bridge(u, v);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
376 KB |
Output is correct |
3 |
Correct |
2 ms |
376 KB |
Output is correct |
4 |
Incorrect |
2 ms |
380 KB |
Wrong Answer [1] |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
376 KB |
Output is correct |
3 |
Correct |
2 ms |
376 KB |
Output is correct |
4 |
Incorrect |
2 ms |
380 KB |
Wrong Answer [1] |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
376 KB |
Output is correct |
3 |
Correct |
2 ms |
376 KB |
Output is correct |
4 |
Incorrect |
2 ms |
380 KB |
Wrong Answer [1] |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
632 KB |
Wrong Answer [1] |
2 |
Halted |
0 ms |
0 KB |
- |