Submission #1110144

#TimeUsernameProblemLanguageResultExecution timeMemory
1110144ozner77Parachute rings (IOI12_rings)C++17
0 / 100
1748 ms262144 KiB
#include <bits/stdc++.h> using namespace std; map<long long,long long> sumas; vector<vector<int>> V; long long con1=0; int n; void Init(int N){ n=N; vector<int> V1(N,0); for(int i=0;i<N;i++){ V.push_back(V1); } } void Link(int A,int B){ V[A][B]=1; V[B][A]=1; sumas[A]++; sumas[B]++; } int CountCritical(){ long long res=0; for(int i=0;i<n;i++){ bool com=true; long long con=0; long long solitos=0; for(int j=0;j<n;j++){ if(i!=j){ if(V[i][j]==1){ sumas[j]--; } if(sumas[j]>2){ com=false; break; } if(sumas[j]==0){ solitos++; if(V[i][j]==1){ sumas[j]++; } continue; } if(sumas[j]==1){ con++; } if(V[i][j]==1){ sumas[j]++; } } } if(solitos!=n-1){ if(con%2!=0 || con==0){ com=false; } } if(com){ res++; } } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...