# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1107689 | ozner77 | Parachute rings (IOI12_rings) | C++17 | 0 ms | 0 KiB |
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;
vector<vector<long long>> V;
vector<long long> sumas;
int init(long long N){
vector<long long> V1(N,0);
for(int i=0;i<N;i++){
V.push_back(V1);
}
}
int Link(long long A,long long B){
V[A][B]=1;
V[B][A]=1;
sumas[A]++;
sumas[B]++;
}
int CountCritical(){
long long critical=0;
for(int i=0;i<V.size();i++){
bool es=true;
for(int j=0;j<V.size();j++){
if(i!=j){
if(V[j][i]==1){
if(sumas[j]-1>2){
es=false;
break;
}
}else{
if(sumas[j]>2){
es=false;
break;
}
}
}
}
if(es){
critical++;
}
}
return critical;
}