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;
#define ff first
#define ss second
#define pb push_back
std::string guess_sequence(int N) {
string s;
vector<string>h={"A","B","X","Y"};
if(press(h[0]+h[1])){
if(press(h[1]))swap(h[0],h[1]);
}
else if(press(h[2])){
swap(h[0],h[2]);
}
else{
swap(h[0],h[3]);
}
s+=h[0];
int k=1;
for(int i=2;i<N;i++){
string tmp=s+h[1]+s+h[2]+h[1]+s+h[2]+h[2]+s+h[2]+h[3];
int t=press(tmp);
if(t==k+1){
s+=h[1];
}
else if(t==k+2){
s+=h[2];
}
else{
s+=h[3];
}
k++;
}
if(press(s+h[1])==k+1){
s+=h[1];
}
else if(press(s+h[2])==k+1){
s+=h[2];
}
else{
s+=h[3];
}
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |