# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
217795 | kkm0476 | Combo (IOI18_combo) | C++11 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "combo.h"
#include <bits/stdc++.h>
using namespace std;
int press(string a)
{
return 0;
}
string guess_sequence(int N)
{
string S;
if (press("AB"))
{
if (press("A"))
S = "A";
else
S = "B";
}
else
{
if (press("X"))
S = "X";
else
S = "Y";
}
while (S.size() < N - 1)
{
int l;
switch (S[0])
{
case 'A':
l = press(S + "BB" + S + "BX" + S + "BY" + S + "X");
if (l == S.size() + 2)
S += "B";
else if (l == S.size() + 1)
S += "X";
else
S += "Y";
break;
case 'B':
l = press(S + "AA" + S + "AX" + S + "AY" + S + "X");
if (l == S.size() + 2)
S += "A";
else if (l == S.size() + 1)
S += "X";
else
S += "Y";
break;
case 'X':
l = press(S + "AA" + S + "AB" + S + "AY" + S + "B");
if (l == S.size() + 2)
S += "A";
else if (l == S.size() + 1)
S += "B";
else
S += "Y";
break;
case 'Y':
l = press(S + "AA" + S + "AB" + S + "AX" + S + "B");
if (l == S.size() + 2)
S += "A";
else if (l == S.size() + 1)
S += "B";
else
S += "X";
break;
}
}
if (press(S + "A" + S + "B") == S.size())
{
if (press(S + "A"))
S += "A";
else
S += "B";
}
else
{
if (press(S + "X"))
S += "X";
else
S += "Y";
}
return S;
}