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"
using namespace std;
typedef long long ll;
string guess_sequence(int N) {
string p = "";
string x = "ABXY";
char z = 'A';
for(int i = 0; i < 4; i++){
p=x[i];
int coin = press(p);
if(coin == 1) z = x[i];
p = "";
}
string S = ""; S+=z;
for(int i = 2; i <= N; i++){
for(int j = 0; j < 4; j++){
if(x[j] == z) continue;
p = S; p+=x[j];
int coin = press(p);
if(coin == i+1){
S+=x[j];
break;
}
}
}
return S;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |