Submission #1093695

#TimeUsernameProblemLanguageResultExecution timeMemory
1093695belgianbotCombo (IOI18_combo)C++17
5 / 100
1 ms344 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { string p = "A"; vector<char> poss = {'B', 'X', 'Y'}; if (N == 1) { if (!press(p)) { p = "BA"; poss = {'A', 'X', 'Y'}; if (!press(p)) { p = "X"; poss = {'A', 'B', 'Y'}; if (!press(p)) { p = "Y"; poss = {'A', 'B', 'X'}; } } } return p; } p = "AB"; int act = press(p); if (act) { p = "A"; if (press(p)) { poss = {'B', 'X', 'Y'}; } else { p = 'B'; poss = {'A', 'X', 'Y'}; } } else { p = "X"; if (press(p)) { poss = {'A', 'B', 'Y'}; } else { p = "Y"; poss = {'A', 'B', 'X'}; } } for (int i = p.size(); i < N; i++) { string test = p; if (i != N - 1) { test += poss[0]; test += p; test += poss[1]; test += poss[0]; test += p; test += poss[1]; test += poss[1]; test += p; test += poss[1]; test += poss[2]; int coins = press(test); if (coins == i + 1) p += poss[0]; else if (coins == i + 2) p += poss[1]; else p += poss[2]; } else { test += poss[0]; int res = press(test); if (res == N) p += poss[0]; else { test = p; test += poss[1]; res = press(test); if (res == N) p += poss[1]; else p += poss[2]; } } } return p; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...