# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
548303 | Killer2501 | 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.
#define fi first
#define se second
#define pb push_back
#include "combo.h"
using namespace std;
using ll = long long;
using ld = long double;
const int N = 3e5 +2;
const int base = 31;
const int mod = 1e9 +7;
int a[4], k;
string guess_sequence(int n)
{
string res;
memset(a, 1, sizeof(a));
for(int i = 1; i <= n; i ++)
{
string s;
if(a[0])
{
k = press(res+"A");
if(k == i)
{
res += "A";
if(i == 1)a[0] = 0;
continue;
}
}
if(a[1])
{
k = press(res+"B");
if(k == i)
{
res += "B";
if(i == 1)a[1] = 0;
continue;
}
}
if(a[2])
{
k = press(res+"X");
if(k == i)
res += "Y";
if(i == 1)a[3] = 0;
}
}
return res;
}