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 lol[] = {"A", "B", "X", "Y"};
vector<string> t;
int taken = 0;
while(press(lol[taken])==0) taken++;
for(int i = 0;i<4;i++){
if(i==taken) continue;
t.push_back(lol[i]);
}
string s = lol[taken];
for(int i = 1;i<(n-1);i++){
int lol1 = press(s + t[0] + lol[taken] + s + t[1] + t[0] + lol[taken] + s + t[1] + t[2] + lol[taken] + s + t[1] + t[1]);
if(lol1==0){
s+=t[2];
}
else if(lol1==(i+1)){
s+=t[0];
}
else{
s+=t[1];
}
}
if(n==1) return s;
taken = 0;
while(press(s+lol[taken])!=n) taken++;
s+=lol[taken];
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |