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;
const char but[5] = "ABXY";
int cc;
char ava[4];
string cur;
void get1() {
int T = 0;
string X;
X = cur + but[0] + cur + but[1];
if(press(X) == (int)cur.size()) T += 2;
X = cur + but[T];
if(press(X) == (int)cur.size()) T += 1;
cur += but[T];
}
void get2() {
string X = cur + ava[1] + cur + ava[2] + ava[0] + cur + ava[2] + ava[1] + cur + ava[2] + ava[2];
cur += ava[press(X) - (int)cur.size()];
}
string guess_sequence(int N) {
get1();
for(int i=0;i<4;i++) {
if(but[i] != cur[0]) ava[cc++] = but[i];
}
while((int)cur.size() < N) {
if((int)cur.size() + 1 == N) get1();
else get2();
}
return cur;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |