제출 #1046618

#제출 시각아이디문제언어결과실행 시간메모리
1046618Jer콤보 (IOI18_combo)C++17
10 / 100
36 ms856 KiB
#include "combo.h" using namespace std; string guess_sequence(int n) { string letters = "ABXY", start, curr, trial; for (char x : letters) { start = x; if (press(start) == 1) { break; } } curr = start; while ((int)curr.size() < n) { bool found_next_char = false; for (char x : letters) { if (x == start[0]) continue; trial = curr + x; int res = press(trial); if (res > (int)curr.size()) { curr += x; found_next_char = true; break; } } if (!found_next_char) break; } return curr; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...