# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
90992 | too_stupid | 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 "combo.h"
#include <bits/stdc++.h>
using namespace std;
string guess_sequence(int n) {
string p = "";
string k = "XYZ";
if(press("A"))
{
p+="A";
for(int i = 1 ; i < 4 * 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 < 4 * 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 < 4 * 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 < 4 * n ; i++)
{
for(int j = 0 ; j < 3 ; ++j)
{
if(press(p + k[j]) == (int)p.size() + 1)
{
p+=k[j];
break;
}
}
}
}
return S;
}