# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
885787 | sq00 | Combo (IOI18_combo) | C++14 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "combo.h"
using namespace std;
string guess_sequence(int N) {
string buttons = "", firstBtn = "";
if(press("A") == 1) {
firstBtn = "A";
buttons = "BYX";
}
else if(press("B") == 1) {
firstBtn = "B";
buttons = "AYX";
}
else if(press("Y") == 1) {
firstBtn = "Y";
buttons = "ABX";
}
else if(press("X") == 1) {
firstBtn = "X";
buttons = "ABY";
}
string current = firstBtn;
while(true) {
for(int i = 0; i < buttons.size(); i++) {
string test = current + buttons[i];
if(press(test) == test.size()) {
current = test;
break;
}
}
if(current.size() == n) break;
}
return current;
}