# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
965020 | ReLice | Combo (IOI18_combo) | C++17 | 19 ms | 2024 KiB |
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 "grader.cpp"
#include <bits/stdc++.h>
#define ll int
#define str string
#define pb push_back
#define pob pop_back()
#define sz size()
#define bc back()
using namespace std;
str guess_sequence(ll n) {
ll i,j;
str s;
vector<char> v={'A','B','X','Y'};
ll x=press("AB");
if(x){
x=press("A");
if(x)s="A";
else s="B";
}else{
x=press("X");
if(x)s="X";
else s="Y";
}
if(n==1)return s;
for(i=0;i<4;i++){
if(v[i]==s[0]){
swap(v[i],v.bc);
v.pob;
break;
}
}
for(i=2;i<n;i++){
x=press(s+v[0]+s+v[1]+v[0]+s+v[1]+v[1]+s+v[1]+v[2]);
if(x==s.sz+1)s+=v[0];
else if(x>s.sz+1)s+=v[1];
else s+=v[2];
}
x=press(s+v[0]+s+v[1]);
if(x==n){
x=press(s+v[0]);
if(x==n)s+=v[0];
else s+=v[1];
}else s+=v[2];
return s;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |