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"
//#include "grader.cpp"
using namespace std;
string guess_sequence(int n) {
string s,t="ABXY";
int k=(press("BY")>0)+(press("XY")>0)*2;
rotate(t.begin(),t.begin()+k,t.end());
s.push_back(t[0]);
for (int i=0; i<n-2; ++i) {
int a=press(s+t[2]+s+t[3]+t[1]+s+t[3]+t[2]+s+t[3]+t[3])-i;
a=min(a,3);
s.push_back(t[a]);
}
if(n==1)return s;
k=(press(s+"B"+s+"Y")==n)+(press(s+"X"+s+"Y")==n)*2;
s.push_back("ABXY"[k]);
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |