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;
int n;
const int N=1e6+100;
vector<int> g[N];
int mx=0;
int me[N];
int freq[7][7];
void Init(int N_) {
n = N_;
}
void Link(int a, int b){
if(mx>=5)return;
g[a].push_back(b);
g[b].push_back(a);
mx=max(mx,(int)g[a].size());
mx=max(mx,(int)g[b].size());
me[g[a].size()]++;
me[g[b].size()]++;
for(auto x:g[a]){
freq[g[a].size()][g[x].size()]++;
}
for(auto x:g[b]){
freq[g[b].size()][g[x].size()]++;
}
}
int CountCritical() {
if(mx>=5)return 0;
if(mx<=2)return n;
if(mx==4){
if(me[4]>1)return 0;
return freq[4][me[3]-1];
}
else{
return freq[3][me[3]-1];
}
}
# | 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... |