This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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]++;
}
int CountCritical() {
int ans=0;
for(int i=0; i<N; i++) {
int tmp=deg[i];
deg[i]=0;
for(int j=0; j<N; j++) {
if(adj[i].count(j)) {
if(deg[j]) deg[j]--;
}
}
bool lol=false;
for(int j=0; j<N; j++) {
if(deg[j]>=3) {
lol=true;
break;
}
}
deg[i]=tmp;
for(int v:adj[i]) {
deg[v]++;
}
ans+=(!lol);
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |