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 pb push_back
string guess_sequence(int N){
char st;
string ans,c;
if(press("AB")){
if(press("A")) st='A';
else st='B';
}else{
if(press("X")) st='X';
else st='Y';
}
if(st!='A') c.pb('A');
if(st!='B') c.pb('B');
if(st!='X') c.pb('X');
if(st!='Y') c.pb('Y');
ans=st;
if(N==1) return ans;
for(int i=1; i<N-1; i++){
int t=press(ans+c[0]+c[0]+ans+c[0]+c[1]+ans+c[0]+c[2]+ans+c[1]);
if(t==i+2) ans+=c[0];
else if(t==i+1) ans+=c[1];
else ans+=c[2];
}
if(press(ans+c[0])==N) return ans+c[0];
else if(press(ans+c[1])==N) return ans+c[1];
else return ans+c[2];
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |