# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
127110 | reda | Combo (IOI18_combo) | C++14 | 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 <bits/stdc++.h>
using namespace std;
string guess_sequence(int N)
{
string t = "" ,v;
int a=press("A"),b=press("B"),x=press("Y"),y=press("Y");
if(a){t.push_back('A');
v= "BXY";
}
if(b){
t.push_back('B');
v= "AXY";
}
if(y)
{
t.push_back('Y');
v="ABX";
}
if(x){
t.push_back('X');
v="ABY" ;
}
int i=0;
while(t.size()!=N)
{
int h=press(t+v[i%N]);
if(h)v.push_back(v[i%N]);
i++;
}
return t;
}