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;
typedef pair<int, int> ii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<long long, long long> pll;
typedef pair<char, int> ci;
typedef pair<string, int> si;
typedef long double ld;
typedef vector<int> vi;
typedef vector<string> vs;
#define pb push_back
#define fi first
#define se second
#define whole(v) v.begin(), v.end()
#define rwhole(v) v.rbegin(), v.rend()
#define inf INT_MAX/2
#define fro front
std::string guess_sequence(int N) {
string s;
char fi;
int c = press("A");
if(c){
fi = 'A';
}else{
c = press("B");
if(c){
fi = 'B';
}else{
c = press("X");
if(c){
fi = 'X';
}else{
fi = 'Y';
}
}
}
char x = 'Y';
if(fi == 'Y'){
x = 'X';
}
char y = 'B';
if(fi == 'B'){
y = 'X';
}
char z = 'A';
if(fi == 'A'){
z = 'X';
}
s.pb(fi);
int lc = 1;
for(int i = 1; i < N; ++i){
string ss = s;
ss.pb(y);
c = press(ss);
ss.pop_back();
if(c > lc){
s.pb(y);
lc = c;
}else{
ss.pb(z);
c = press(ss);
if(c > lc){
s.pb(z);
lc = c;
}else{
s.pb(x);
lc++;
}
}
}
//cout << s << endl;
return s;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |