Submission #412650

# Submission time Handle Problem Language Result Execution time Memory
412650 2021-05-27T09:24:53 Z A_D Parachute rings (IOI12_rings) C++14
0 / 100
403 ms 50068 KB

#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
1 Correct 16 ms 23756 KB Output is correct
2 Incorrect 18 ms 23900 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 380 ms 46896 KB Output is correct
2 Incorrect 403 ms 50068 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 16 ms 23756 KB Output is correct
2 Incorrect 18 ms 23900 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 16 ms 23756 KB Output is correct
2 Incorrect 18 ms 23900 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 16 ms 23756 KB Output is correct
2 Incorrect 18 ms 23900 KB Output isn't correct
3 Halted 0 ms 0 KB -