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 ii pair<int,int>
#define fi first
#define se second
#define ll long long
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
const int mxn = 1e5;
const string t = "ABXY";
string guess_sequence(int N) {
string s = "";
int ptr = 0;
int dif = -1;
while(ptr<N){
int cnt = 0;
for(int i=0; i<4; i++){
if(i==dif)continue;
if(cnt==2){
s=s+t[i];
if(ptr==0){
dif=i;
}
break;
}
int now = press(s+t[i]);
if(now==ptr+1){
s=s+t[i];
if(ptr==0){
dif=i;
}
break;
}
cnt++;
}
ptr++;
}
return s;
}
/*
int main(){
//ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
guess_sequence(5);
return 0;
}
// */
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |