# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1014419 | rayan_bd | Combo (IOI18_combo) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
string guess_sequence(int N){
string p="";
if(press("A")==1) p="A";
else if(press("B")==1) p="B";
else if(press("Y")==1) p="Y";
else p="X";
if(N==1) return p;
if(N>3) return "";
queue<string> q;
q.push(p);
vector<string> choice={"A","B","X","Y"};
while(q.size()){
string last=q.front();q.pop();
if(last.size()==N) return last;
for(auto it:choice){
if(it[0]!=last[0]&&press(last+it)==last.size()+1){
q.push(last+it);
break;
}
}
}
return p;
}