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) {
char arr[4];
char arr1[3];
int a,cur;
arr[0]='A';
arr[1]='B';
arr[2]='X';
arr[3]='Y';
string p="";
for(int j=0;j<4;j++){
if(j==3){
a=3;
p+=arr[3];
break;
}
if(press(p+arr[j])==1){
a=j;
p+=arr[j];
break;
}
}
cur=0;
for(int i=0;i<4;i++){
if(a!=i){
arr1[cur]=arr[i];
cur++;
}
}
for(int i=1;i<n;i++) {
for(int j=0;j<3;j++){
if(j==2){
p+=arr1[2];
break;
}
if(press(p+arr1[j])==i+1){
p+=arr1[j];
break;
}
}
}
return p;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |