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;
string guess_sequence(int N) {
string R="";
int comboCur=0;
string target="ABXY";
bool cond=false;
for (int j=0;(j<3)&&(!cond); j++) {
R.push_back(target[j]);
if (press(R) > comboCur) {
if (j==0) target="BXY";
if (j==1) target="AXY";
if (j==2) target="ABY";
if (j==3) target="ABX";
cond=true;
}
else R.pop_back();
}
if (!cond) {
R.push_back('Y');
target="ABX";
cond=false;
}
comboCur++;
for (int i=1;i<N;i++) {
bool cond1=false;
for (int j=0;j<2; j++) {
R.push_back(target[j]);
if (press(R) > comboCur) {cond1=true; break; }
R.pop_back();
}
if (!cond1) R.push_back(target[2]);
comboCur++;
}
return R;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |