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 ans="", s="", x;
x="A";
int nilai=press(x);
if(nilai==1){
ans=x;
}
x="B";
nilai=press(x);
if(nilai==1) ans=x;
x="X";
nilai=press(x);
if(nilai==1) ans=x;
x="Y";
if(ans=="") ans=x;
for(int i=1;i<n;++i){
string tmp=ans;
tmp+="X";
nilai=press(x);
if(nilai==(i+1)){
ans=tmp;
continue;
}
tmp=ans;
tmp+="Y";
nilai=press(x);
if(nilai==(i+1)){
ans=tmp;
continue;
}
tmp=ans;
tmp+="A";
nilai=press(x);
if(nilai==(i+1)){
ans=tmp;
continue;
}
tmp=ans;
tmp+="B";
ans=tmp;
continue;
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |