# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
79476 | alextodoran | 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;
int press(string p);
string b[] = {"A", "B", "X", "Y"};
vector <string> b1;
string guess_sequence(int N)
{
string pref = "";
if(press("AX"))
{
if(press("A"))
pref = "A";
else
pref = "X";
}
else
{
if(press("B"))
pref = "B";
else
pref = "Y";
}
for(int i = 0; i < 4; i++)
if(b[i] != pref)
b1.push_back(b[i]);
for(int i = 1; i < N - 1; i++)
{
int q = press(pref + b1[0] + pref + b1[1] + b1[0] + pref + b1[1] + b1[1] + pref + b1[1] + b1[2]);
if(q == pref.size())
pref += b1[2];
else if(q == pref.size() + 1)
pref += b1[0];
else
pref += b1[1];
}
if(press(pref + b1[0] + pref + b1[1]) > pref.size())
{
if(press(pref + b1[0]) > pref.size())
pref += b1[0];
else
pref += b1[1];
}
else
pref += b1[2];
return pref;
}
int main()
{
return 0;
}