Submission #591280

#TimeUsernameProblemLanguageResultExecution timeMemory
591280MahtimursuCave (IOI13_cave)C++17
0 / 100
2085 ms13080 KiB
#include "cave.h" #include <bits/stdc++.h> using namespace std; void exploreCave(int N) { int S[N] = {0}; int D[N] = {0}; vector<int> left; for (int i = 0; i < N; ++i) left.push_back(i); for (int i = 0; i < N; ++i) { for (int x : left) { S[x] = 1; } int cp = 0; if (tryCombination(S) > i) cp = 1; vector<int> pos = left; vector<int> a, b; while (pos.size() > 1) { for (int x : pos) { if (a.size() < b.size()) a.push_back(x); else b.push_back(x); } for (int x : a) S[x] = cp; for (int x : b) S[x] = 1 - cp; if (tryCombination(S) > i) pos = a; } D[pos[0]] = i; S[pos[0]] = cp; left.erase(find(left.begin(), left.end(), pos[0])); } answer(S, D); }
#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...