Submission #1131487

#TimeUsernameProblemLanguageResultExecution timeMemory
1131487YouKnowCipherCombo (IOI18_combo)C++20
0 / 100
0 ms408 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { string s, t; if (press("AB")) { s = (press("A")) ? "A" : "B"; } else { s = (press("X")) ? "X" : "Y"; } if (s == "A") t = "BXY"; else if (s == "B") t = "AXY"; else if (s == "X") t = "ABY"; else t = "ABX"; for (int i = 2; i < N + 2; i++) { string tmp = s + t[0] + t[0] + s + t[0] + t[1] + s + t[0] + t[2] + s + t[1]; int cost = press(tmp); if (cost == i + 1) s += t[0]; else if (cost == i) s += t[1]; else s += t[2]; } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...