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;
std::string guess_sequence(int N) {
vector<char> v = {'A','B','X','Y'};
string p = "",tmp;
int cur=0;
for(int i = 0;i<N;i++) {
int ch = 0;
for(int k = 0;k<4;k++) {
if(i>0 && v[k] == p[0]) continue;
tmp = p + v[k];
int res = press(tmp);
if(res>cur){
cur = res;
p = tmp;
ch = 1;
break;
}
}
if(!ch)return p;
}
return p;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |