Submission #1008998

#TimeUsernameProblemLanguageResultExecution timeMemory
1008998SulAParachute rings (IOI12_rings)C++17
0 / 100
4006 ms30932 KiB
#include <vector> using namespace std; vector<vector<int>> adj; vector<int> degree; int n; void Init(int N_) { n = N_; adj.resize(n, vector<int>{}); degree.resize(n, 0); } void Link(int u, int v) { adj[u].push_back(v); adj[v].push_back(u); degree[u]++, degree[v]++; } int CountCritical() { int cnt = 0; for (int u = 0; u < n; u++) { // trying to remove node u for (int v : adj[u]) { degree[v]--; } bool isCritical = true; for (int v = 0; v < n; v++) { if (v == u) continue; isCritical &= degree[v] <= 2; } cnt += isCritical; for (int v : adj[u]) { degree[v]++; } } return cnt; }
#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...