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) {
string s;
string ans;
auto first_subtask = [&](int n){
string cur = "ABXY";
for (int i = 0;i<4;++i){
string t;
t+=cur[i];
if (press(t) == 1){
for (int j = 0;j<4;++j){
if (i != j){
s+=cur[j];
}
}
ans = t;
break;
}
}
do{
//cout<<ans + s<<'\n';
string temp = ans;
for (int i = 0;i<2;++i){
temp+=s[i];
}
if (press(temp) == 3){
ans = temp;
break;
}
}while(next_permutation(s.begin(),s.end()));
return ans;
};
string v = first_subtask(N);
//cout<<v<<'\n';
return v;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |