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