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"
#include "combo.h"
//#define int long long
#define all(v) v.begin() , v.end()
#define sz(a) (int)a.size()
using namespace std;
vector<char> v;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
int ask(string s,int ekle){
s.push_back(v[ekle]);
return press(s);
}
string guess_sequence(int n){
string res="";
if(press("A")==1){
res.push_back('A');
v.push_back('B');
v.push_back('X');
v.push_back('Y');
}
else{
v.push_back('A');
if(press("B")==1){
res.push_back('B');
v.push_back('X');
v.push_back('Y');
}
else{
v.push_back('B');
if(press("X")==1){
res.push_back('X');
v.push_back('Y');
}
else{
res.push_back('Y');
v.push_back('X');
}
}
}
for(int i=1;i<n;i++){
bool ok=0;
shuffle(all(v),rng);
for(int j=0;j<2;j++){
if(ask(res,j)==i+1){
res.push_back(v[j]);
ok=1;
break;
}
}
if(!ok) res.push_back(v.back());
}
return res;
}
/*void _(){
}
int32_t main(){
cin.tie(0); ios::sync_with_stdio(0);
int tc=1;//cin >> tc;
while(tc--) _();
return 0;
}*/
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |