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 "bits/stdc++.h"
#include "combo.h"
using namespace std;
string guess_sequence(int n)
{
string res = "";
set<string>st = {"A","B","X","Y"};
string str = "";
if (press("A"))
{
res += "A";
st.erase("A");
}
else if (press("B"))
{
res += "B";
st.erase("B");
}
else if (press("X"))
{
res += "X";
st.erase("X");
}
else
{
res += "Y";
st.erase("Y");
}
str = *st.begin();
st.erase(st.begin());
bool f = 0;
for (int i = 2; i <= n; ++i)
{
f = 0;
for (auto x : st)
{
if (press(res + x) > i-1)
{
res += x;
f = 1;
break;
}
}
if (!f)
{
res += str;
}
}
return res;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |