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 p = "";
string k = "XYZ";
if(press("A"))
{
p+="A";
for(int i = 1 ; i < n ; i++)
{
for(int j = 0 ; j < 3 ; ++j)
{
if(press(p + k[j]) == (int)p.size() + 1)
{
p+=k[j];
break;
}
}
}
}
else if(press("B"))
{
p+="B";
for(int i = 1 ; i < n ; i++)
{
for(int j = 0 ; j < 3 ; ++j)
{
if(press(p + k[j]) == (int)p.size() + 1)
{
p+=k[j];
break;
}
}
}
}
else if(press("X"))
{
p+="X";
for(int i = 1 ; i < n ; i++)
{
for(int j = 0 ; j < 3 ; ++j)
{
if(press(p + k[j]) == (int)p.size() + 1)
{
p+=k[j];
break;
}
}
}
}
else
{
p+="Y";
for(int i = 1 ; i < n ; i++)
{
for(int j = 0 ; j < 3 ; ++j)
{
if(press(p + k[j]) == (int)p.size() + 1)
{
p+=k[j];
break;
}
}
}
}
return p;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |