# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
164713 | IgorI | Combo (IOI18_combo) | C++17 | 2 ms | 200 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 <iostream>
#include <string>
using namespace std;
typedef long long ll;
string guess_sequence(int n)
{
string s;
int r = press("AB");
if (r)
{
int q = press("A");
if (q) s += "A";
else s += "B";
} else {
int q = press("X");
if (q) s += "X";
else s += "Y";
}
for (int i = 1; i < n; i++)
{
string r;
int q;
if (s[0] == 'A') r = s + "BB" + s + "BX" + s + "BY" + s + "X";
if (s[0] == 'B') r = s + "AA" + s + "AX" + s + "AY" + s + "X";
if (s[0] == 'X') r = s + "AA" + s + "AB" + s + "AY" + s + "B";
if (s[0] == 'Y') r = s + "AA" + s + "AB" + s + "AX" + s + "B";
q = press(r) - i;
if (s[0] == 'A') if (q == 0) s += "Y"; else if (q == 1) s += "X"; else if (q == 2) s += "B";
if (s[0] != 'A')
{
if (q == 2) s += "A";
if (s[0] == 'B') if (q == 0) s += "Y"; else if (q == 1) s += "X";
if (s[0] != 'B')
{
if (q == 1) s += "B";
if (s[0] == 'X') if (q == 0) s += "Y";
if (s[0] != 'X')
{
if (q == 0) s += 'X';
}
}
}
}
return s;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |