Submission #58571

#TimeUsernameProblemLanguageResultExecution timeMemory
58571Mamnoon_SiamICC (CEOI16_icc)C++17
0 / 100
400 ms868 KiB
#include "icc.h" #include <bits/stdc++.h> using namespace std; 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) { n = N; while(true) { 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...