# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
206471 | vardan__02 | 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 <algorithm>
#include <iostream>
#include <fstream>
#include <cstring>
#include <string>
#include <vector>
#include <cstdio>
#include <queue>
#include <deque>
#include <stack>
#include <list>
#include <set>
#include <map>
#include "combo.h"
using namespace std;
string guess_sequence(int N)
{
string ans="";
string ban="ABXY";
int v=0, x;
x = press("A")
if(x==1)
v=0;
x = press("B")
if(x==1)
v=1;
x = press("X")
if(x==1)
v=2;
x = press("Y")
if(x==1)
v=3;
ans=ban[v];
while(ans.size()!=N)
{
for(int i=0;i<=3;i++)
{
if(i==v)
continue;
x = press(ans+ban[i]);
if(x==ans.size()+1)
{
ans+=ban[i];
break;
}
}
}
return ans;
}