# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
216484 | T0p_ | 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 = "";
//first letter
int ab = press("AB");
if(ab == 0)
{
if(press("X")) s += 'X';
else s += 'Y';
}
else
{
if(press("A")) s += 'A';
else s += 'B';
}
for(int i=2 ; i<=n ; i++)
{
string test = "":
test += s;
test += "XX";
test += s;
test += "XY";
test += s;
test += "XZ";
test += s;
test += "Y";
test += s[0];
int ret = press(test);
if(ret == 0) s += 'Z';
else if(ret == 1) s += 'Y';
else s += 'X';
}
return s;
}