Submission #1187394

#TimeUsernameProblemLanguageResultExecution timeMemory
1187394nagorn_phCombo (IOI18_combo)C++20
100 / 100
7 ms484 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; string guess_sequence(int n) { string s = ""; string can = ""; int op = 0; if (press("AB")) { if (press("A")) { can = "BXY"; s += 'A'; } else { can = "AXY"; s += 'B'; } } else { if (press("X")) { can = "ABY"; s += 'X'; } else { can = "ABX"; s += 'Y'; } } if (n == 1) return s; while (s.length() < n - 1) { string curr = s + can[0] + s + can[1] + can[0] + s + can[1] + can[1] + s + can[1] + can[2]; op = press(curr); if (op == s.length()) s += can[2]; else if (op == s.length() + 1) s += can[0]; else if (op == s.length() + 2) s += can[1]; } if (press(s + can[0]) == n) s += can[0]; else if (press(s + can[1]) == n) s += can[1]; else s += can[2]; return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...