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 ret = "";
char exc, arr[4] = {'A', 'B', 'X', 'Y'};
if (press("A") == 1){
ret = "A"; exc = 'A';
}
else if (press("B") == 1){
ret = "B"; exc = 'B';
}
else if (press("X") == 1){
ret = "X"; exc = 'X';
}
else {
ret = "Y"; exc = 'Y';
}
int cnt = 2;
while ((int)ret.size() < N){
for (int i = 0; i < 4; i++){
if (arr[i] != exc){
string temp = ret;
temp += arr[i];
if (press(temp) == cnt){
ret = temp;
cnt++;
break;
}
}
}
}
return ret;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |