제출 #859119

#제출 시각아이디문제언어결과실행 시간메모리
859119Pekiban콤보 (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) { char f; if (press("AB")) { if (press("A")) f = 'A'; else f = 'B'; } else { if (press("X")) f = 'X'; else f = 'Y'; } 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; } 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...