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;
string guess_sequence(int N) {
string s = "";
string t = "ABXYABXY";
int c = press("ABB");
if (c == 2)
{
s += 'A';
}
else if (c == 1)
s += 'B';
else
{
c = press("XYY");
if (c == 1)
s += 'Y';
else
s += 'X';
}
int idx = 0;
for (int i = 0; i < 4; i++) if(s[0] == t[i]) {idx = i; break;}
char q1 = t[idx + 1], q2 = t[idx + 2], q3 = t[idx + 3];
for (int i = 1; i < N; i++)
{
c = press(s + q1 + s + q2 + q1 + s + q2 + q2 + s + q2 + q3);
if (!c) s += q3;
else if (c == 1) s += q1;
else s += q2;
}
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |