Submission #800712

#TimeUsernameProblemLanguageResultExecution timeMemory
800712BERNARB01Game (IOI14_game)C++17
15 / 100
1100 ms243144 KiB
#include <bits/stdc++.h> #include "game.h" using namespace std; #ifdef B01 #include "../deb.h" #else #define deb(...) #endif const int N = 2003; int n; set<vector<int>> se; void initialize(int n_) { n = n_; vector<int> p(n); iota(p.begin(), p.end(), 0); do { se.insert(p); } while (next_permutation(p.begin(), p.end())); } int hasEdge(int u, int v) { vector<vector<int>> rem; for (const auto& p : se) { bool bl = false; for (int i = 0; i < n - 1; i++) { if ((p[i] == u && p[i + 1] == v) || (p[i] == v && p[i + 1] == u)) { bl = true; } } if (bl) { rem.push_back(p); } } if (se.size() == rem.size()) { return 1; } for (const auto& p : rem) { se.erase(p); } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...