제출 #859121

#제출 시각아이디문제언어결과실행 시간메모리
859121Pekiban콤보 (IOI18_combo)C++17
0 / 100
0 ms344 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; std::string guess_sequence(int n) { string f; if (press("AB")) { if (press("A")) { f = 'A'; } else { f = 'B'; } } else { if (press("X")) { f = 'X'; } else { f = 'Y'; } } cout << f << endl; if (n == 1) return f; string curr = ""; curr += f; char p, q, r; if (f == "A") { p = 'B', q = 'X', r = 'Y'; } else if (f == "B") { p = 'A', q = 'X', r = 'Y'; } else if (f == "X") { p = 'A', q = 'B', r = 'Y'; } else { p = 'A', q = 'B', r = 'X'; } for (int i = 1; i+1 < n; ++i) { const int z = press((curr+p)+p+(curr+p)+q+(curr+p)+r+(curr+q)); if (z == i+2) { curr += p; } else if (z == i+1) { curr += q; } else { curr += r; } } if (press(curr+p+curr+q) == n) { if (press(curr+p) == n) curr += p; else { curr += q; } } else { curr += r; } return curr; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...