# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
160282 | MarcoMendoza1 | Combo (IOI18_combo) | C++14 | 1 ms | 200 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 <bits/stdc++.h>
#include "combo.h"
using namespace std;
string r="",aux;
char arr[4];
string guess_sequence(int n){
if(press("AB")){
arr[1]='X';
arr[3]='Y';
if(press("A")){
arr[2]='B';
r="A";
}else{
arr[2]='A';
r="B";
}
}else{
arr[1]='A';
arr[2]='B';
if(press("X")){
arr[3]='Y';
r="X";
}else{
arr[3]='X';
r="Y";
}
}
int ax;
while(r.size()<(n-1)){
aux=r+arr[2]+r+arr[1]+arr[1]+r+arr[1]+arr[2]+r+arr[1]+arr[3];
ax=press(aux);
if(ax==r.size()){
r=r+arr[3];
}else if(ax==(r.size()+1)){
r=r+arr[2];
}else{
r=r+arr[1];
}
}
if(press(r+arr[1]+r+arr[2])==n){
if(press(r+arr[1])==n){
return r+arr[1];
}else{
return r+arr[2];
}
}else{
return r+arr[3];
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |