Submission #58588

#TimeUsernameProblemLanguageResultExecution timeMemory
58588Mamnoon_SiamICC (CEOI16_icc)C++17
0 / 100
277 ms748 KiB
#include "icc.h" #include <bits/stdc++.h> using namespace std; namespace { const int maxn = 105; int n; int ok[maxn][maxn]; }; int ask(vector<int> x, vector<int> y) { int size_a = x.size(), size_b = y.size(); int a[size_a], b[size_b]; for(int i = 0; i < size_a; i++) a[i] = x[i]; for(int i = 0; i < size_b; i++) b[i] = y[i]; return query(size_a, size_b, a, b); } int chex(int u) { vector<int> a = {u}, b; for(int i = 1; i <= n; i++) { if(i != u and !ok[u][i]) { b.push_back(i); } } if(b.empty()) return 0; return ask(a, b); } int find_another(int u) { for(int i = 1; i <= n; i++) { if(i != u and !ok[u][i]) { if(ask({u}, {i})) { return i; } } } assert(false); } void run(int N) { memset(ok, 0, sizeof ok); n = N; int rnd = n - 1; while(rnd--) { int u = 0; for(int i = 1; i <= n; i++) if(chex(i)) { u = i; break; } int v = find_another(u); setRoad(u, v); ok[u][v] = ok[v][u] = 1; } }
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...