Submission #763093

#TimeUsernameProblemLanguageResultExecution timeMemory
763093t6twotwo콤보 (IOI18_combo)C++17
5 / 100
1 ms256 KiB
#include "combo.h" using namespace std; string a[] = {"A", "B", "X", "Y"}; std::string guess_sequence(int N) { int f = 0; if (press("AB")) { f = press("B"); } else { f = press("Y") + 2; } string ans = a[f]; string x = a[f == 0 ? 1 : 0]; string y = a[f <= 1 ? 2 : 1]; string z = a[f == 3 ? 2 : 3]; for (int i = 1; i < N - 1; i++) { int t = press(ans + x + ans + y + x + ans + y + y + ans + y + z); if (t == i + 1) { ans = ans + x; } else if (t == i + 2) { ans = ans + y; } else { ans = ans + z; } } if (press(ans + "A" + ans + "B") == N) { if (press(ans + "A") == N) { ans += 'A'; } else { ans += 'B'; } } else { if (press(ans + "X") == N) { ans += 'X'; } else { ans += 'Y'; } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...