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 cur = "";
vector<string> c = {"A", "B", "X", "Y"};
if(press(c[0]+c[1]))
if(press(c[0])) cur = c[0];
else cur = c[1], swap(c[0], c[1]);
else if(press(c[2])) cur = c[2], swap(c[0], c[2]);
else cur = c[3], swap(c[3], c[0]);
for(int i = 2; i<=n-1; ++i){
int res = press(cur+c[1]+cur+c[2]+c[1]+cur+c[2]+c[2]+cur+c[2]+c[3]);
if(res==(int)cur.size()+1) cur += c[1];
else if(res==(int)cur.size()+2) cur += c[2];
else cur += c[3];
}
if(press(cur+c[1])==n) cur += c[1];
else if(press(cur+c[2])==n) cur += c[2];
else cur += c[3];
return cur;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |