#include <bits/stdc++.h>
using namespace std;
int n, cnt = 0;
vector <int> deg;
vector <vector <int>> g;
void Init(int N_) {
n = N_;
deg.resize(n);
g.resize(n);
}
void Link(int A, int B) {
deg[A] ++;
deg[B] ++;
g[A].push_back(B);
g[B].push_back(A);
if (deg[A] == 3) cnt ++;
if (deg[B] == 3) cnt ++;
}
int CountCritical() {
int res = 0;
for (int v = 0; v < n; v ++) {
int cur = 0;
if (deg[v] > 2) cur ++;
for (auto i: g[v]) {
if (deg[i] == 3) cur ++;
}
if (cur == cnt) res ++;
}
return res;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
2 ms |
468 KB |
Output is correct |
3 |
Correct |
2 ms |
596 KB |
Output is correct |
4 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
322 ms |
30944 KB |
Output is correct |
2 |
Correct |
607 ms |
57932 KB |
Output is correct |
3 |
Correct |
710 ms |
67532 KB |
Output is correct |
4 |
Incorrect |
755 ms |
72364 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
2 ms |
468 KB |
Output is correct |
3 |
Correct |
2 ms |
596 KB |
Output is correct |
4 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
2 ms |
468 KB |
Output is correct |
3 |
Correct |
2 ms |
596 KB |
Output is correct |
4 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
2 ms |
468 KB |
Output is correct |
3 |
Correct |
2 ms |
596 KB |
Output is correct |
4 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |