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>
#define st first
#define nd second
#define mp make_pair
#define pb push_back
#define sol (k+k)
#define sag (k+k+1)
#define orta ((bas+son)/2)
#define coc g[node][i]
#define mod 1000000007
#define inf 1000000009
#define MAXN 1000005
using namespace std;
typedef long long ll;
typedef pair < int , int > ii;
int n, m, ilk;
map < int , char > h, x;
string guess_sequence(int n) {
h[1] = 'A';
h[2] = 'B';
h[3] = 'X';
h[4] = 'Y';
for(int i = 1; i <= 4; i++){
string s = "";
s += h[i];
if(press(s) > 0){
ilk = i;
break;
}
}
string s;
s += h[ilk];
for(int i = 1; i <= 4; i++){
if(i == ilk)continue;
x[++m] = h[i];
}
// cout << n << " " << ilk << endl;
for(int i = 2; i <= n - 1; i++){
string sor = "";
sor += s + x[1] + x[1];
sor += s + x[1] + x[2];
sor += s + x[1] + x[3];
sor += s + x[2];
int ans = press(sor);
if(ans == i)
s += x[2];
else if(ans == i + 1)
s += x[1];
else
s += x[3];
}
for(int i = 1; i <= 3; i++){
if(press(s + x[i]) == n){
s += x[i];
break;
}
}
// cout << s << endl;
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |