# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
167324 | muhammad_hokimiyon | 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 s;
vector < string > t;
if( press( "AB" ) > 0 ){
if( press( "A" ) == 1 ){
s = "A";
t = { "B" , "X" , "Y" };
}
else{
s = "B";
t = { "B" , "X" , "Y" };
}
}
else{
if( press( "X" ) == 1 ){
s = "X";
t = { "A" , "B" , "Y" };
}
else{
s = "Y";
t = { "A" , "B" , "X" };
}
}
if( N == 1 )return s;
for( int i = 1; i < N - 1; i++ ){
string g = s + t[0] + s + t[1] + t[0] + s + t[1] + t[1] + s + t[1] + t[2];
int c = press(g);
if( c == i )s += t[2];
else if( c == i + 1 )s += t[0];
else s += t[1];
}
if( press( s + "A" + s + "B" ) == N ){
if( press( s + "A" ) == 1 ){
s += "A";
}
else{
s += "B";
}
}
else{
if( press( s + "X" ) == N ){
s += "X";
}
else{
s += "Y";
}
}
return s;
}