# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
79476 | alextodoran | 콤보 (IOI18_combo) | C++14 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "combo.h"
using namespace std;
int press(string p);
string b[] = {"A", "B", "X", "Y"};
vector <string> b1;
string guess_sequence(int N)
{
string pref = "";
if(press("AX"))
{
if(press("A"))
pref = "A";
else
pref = "X";
}
else
{
if(press("B"))
pref = "B";
else
pref = "Y";
}
for(int i = 0; i < 4; i++)
if(b[i] != pref)
b1.push_back(b[i]);
for(int i = 1; i < N - 1; i++)
{
int q = press(pref + b1[0] + pref + b1[1] + b1[0] + pref + b1[1] + b1[1] + pref + b1[1] + b1[2]);
if(q == pref.size())
pref += b1[2];
else if(q == pref.size() + 1)
pref += b1[0];
else
pref += b1[1];
}
if(press(pref + b1[0] + pref + b1[1]) > pref.size())
{
if(press(pref + b1[0]) > pref.size())
pref += b1[0];
else
pref += b1[1];
}
else
pref += b1[2];
return pref;
}
int main()
{
return 0;
}