# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
385594 | ismoilov | 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 "combo.h"
#include<bits/stdc++.h>
using namespace std;
string guess_sequence(int N) {
int n = N;
string s, c = "ABXY";
fp(i,0,4)
{
fp(j,0,n)
s += c[i];
int x = press(s);
if(x > 0)
break;
s = "";
}
c.erase((c.find(s[0])), 1);
int f = 1, i = 1, j = 0;
while(f != n)
{
for(int k = i; k < n; k ++)
s[k] = c[j];
int x = press(s);
if(x == f)
j ++, j %= 3;
else
{
i += x - f, f = x, j = (j + 1)%3;
}
}
return s;
}