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;
#define pb push_back
set<char> st = {'A', 'B', 'X', 'Y'};
string guess_sequence(int n) {
srand(time(0));
string ans="";
vector<char> c;
for(char ch : st){
if(press(ans+ch)){
ans.pb(ch);
for(char cch : st) if(cch != ch) c.pb(cch);
break;
}
}
for(int i = 1; i < n; ++i){
random_shuffle(c.begin(), c.end());
for(char ch : c){
if(press(ans + ch) == i+1){
ans.pb(ch);
break;
}
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |