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){
bool found = 0;
for(int i = 0; i < 2; ++i){
if(press(ans + c[i]) == i+1){
found = 1;
ans.pb(c[i]);
break;
}
}
if(!found) ans.pb(c[2]);
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |