# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
92974 | temoyanteladze | 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>
#include "combo.h"
using namespace std;
string guess_sequence(int n)
{
string s;
string ch;
if (press("A"))
{
s+="A";
ch="A";
}
if (press("B"))
{
s+="B";
ch="B";
}
if (press("X"))
{
s+="X";
ch="X";
}
if (press("Y"))
{
s+="Y";
ch="Y";
}
for (int i=2;i<=n;i++)
{
string c;
c=s+"A";
if (ch!="A")
if (press(c)==i)
s+="A";
c=s;
c+="B";
if (ch!="B")
if (press(c)==i)
s+="B";
c=s;
c+="X";
if (ch!="X")
if (press(x)==i)
s+="X";
c=s;
c+="Y";
if (ch!="Y")
if (press(x)==i)
s+="Y";
}
return s;
}