#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
typedef long long int ll;
int N;
const int M=1e6+7;
set<int> adj[M];
int deg[M];
void Init(int N_) {
N = N_;
}
void Link(int A, int B) {
adj[A].insert(B);
adj[B].insert(A);
deg[A]++;
deg[B]++;
}
bool is(int x){
for(int v:adj[x]) {
deg[v]--;
}
for(int v=0; v<N; v++) {
if(v==x) {
continue;
}
if(deg[v]>2) {
return 0;
}
}
for(int v:adj[x]) {
deg[v]++;
}
return 1;
}
int CountCritical() {
int ans=0;
for(int x=0; x<N; x++) ans+=is(x);
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
44 ms |
47352 KB |
Output is correct |
2 |
Incorrect |
53 ms |
47736 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4014 ms |
98020 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
44 ms |
47352 KB |
Output is correct |
2 |
Incorrect |
53 ms |
47736 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
44 ms |
47352 KB |
Output is correct |
2 |
Incorrect |
53 ms |
47736 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
44 ms |
47352 KB |
Output is correct |
2 |
Incorrect |
53 ms |
47736 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |