#include <bits/stdc++.h>
using namespace std;
int N;
int deg[1000000];
void Init(int N_) {
N = N_;
}
set<int> adj[1000000];
set<int> s;
void Link(int A, int B) {
adj[A].insert(B), adj[B].insert(A);
deg[A]++, deg[B]++;
if(deg[A]>2) s.insert(A);
if(deg[B]>2) s.insert(B);
}
int CountCritical() {
int res=0;
for(int i=0;i<N;i++){
int ok=1;
for(int v:s){
if(i!=v && adj[i].find(v)==adj[i].end()){
ok=0;
break;
}
}
res+=ok;
}
return res;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
52 ms |
47224 KB |
Output is correct |
2 |
Incorrect |
43 ms |
47732 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
602 ms |
98420 KB |
Output is correct |
2 |
Incorrect |
1137 ms |
125836 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
52 ms |
47224 KB |
Output is correct |
2 |
Incorrect |
43 ms |
47732 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
52 ms |
47224 KB |
Output is correct |
2 |
Incorrect |
43 ms |
47732 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
52 ms |
47224 KB |
Output is correct |
2 |
Incorrect |
43 ms |
47732 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |