Submission #526038

#TimeUsernameProblemLanguageResultExecution timeMemory
526038benjaminkleynCombo (IOI18_combo)C++17
0 / 100
1 ms200 KiB
#include "combo.h" std::string guess_sequence(int N) { std::string S; std::string pos; // find first letter (3 presses) if (press("A")) pos = "BXY", S = "A"; else if (press("B")) pos = "AXY", S = "B"; else if (press("X")) pos = "ABY", S = "X"; else pos = "ABX", S = "Y"; // find next N-1 letters (N-1 presses) for (int i = 0; i < N - 1; i++) { // the length of this string will always be < 4N. int coins = press(S + pos[0] + pos[0] + S + pos[0] + pos[1] + S + pos[0] + pos[2] + S + pos[1]); if (coins == i + 3) S += pos[0]; else if (coins == i + 2) S += pos[1]; else S += pos[2]; } return S; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...