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 <bits/stdc++.h>
#define ll long long
#define pb push_back
#define all(x) x.begin(), x.end()
#define F first
#define ld long double
#define S second
using namespace std;
const ll N = 5e3 + 5;
const ll NN = 4e5 + 5;
const ll INF = 1e18;
const ll inf = 1e9;
const ll MOD = 1e9 + 7;
char a[10];
int was[10];
int press(std::string p);
string guess_sequence(int n){
a[1] = 'A';
a[2] = 'B';
a[3] = 'X';
a[4] = 'Y';
string s = "";
int res = 0;
for(int i = 1;i <= n;i++){
for(int j = 1;j <= 4;j++){
if(was[j] == 1)continue;
s += a[j];
int val = press(s);
if(val > res){
if(i == 1){
was[j] = 1;
}
res = val;
break;
}
s.pop_back();
}
}
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |