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) {
string aux("ABXY");
string use="";
string S="";
int coins=0;
for (int i=0; i<4; i++){
string gg;
gg.push_back(aux[i]);
coins=press(gg);
if (coins){
S+=aux[i];
for(int j=0; j<4; j++) if (aux[j]!=aux[i]) use.push_back(aux[j]);
break;
}
}
while((int)S.size()!=N){
for (int i=0; i<3; i++){
S+=use[i];
int ne=press(S);
if (ne==coins+1){
coins=ne;
break;
}else S.pop_back();
}
}
return S;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |