# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
91506 | javert2001 | Combo (IOI18_combo) | C++14 | 46 ms | 552 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;
std::string guess_sequence(int N) {
string ret;
string manda;
char uno;
char dos;
char tres;
manda='A';
manda+='B';
if(press(manda)==0){
manda='X';
if(press(manda)==1){
ret='X';
uno = 'A';
dos = 'B';
tres = 'Y';
}else{
ret='Y';
uno = 'A';
dos = 'B';
tres = 'X';
}
}else{
manda='A';
if(press(manda)==1){
ret='A';
uno = 'X';
dos = 'B';
tres = 'Y';
}else{
ret='B';
uno = 'A';
dos = 'X';
tres = 'Y';
}
}
if(N==1)return ret;
for(int i=2;i<N;i++){
manda=ret;
manda+=uno;
manda+=ret;
manda+=dos;
manda+=uno;
manda+=ret;
manda+=dos;
manda+=dos;
manda+=ret;
manda+=dos;
manda+=tres;
int act=press(manda);
if(act==ret.size()){
ret+=tres;
}else
if(act==ret.size()+1){
ret+=uno;
}else{
ret+=dos;
}
}
manda=ret;
manda+=uno;
if(press(manda)==N){
ret+=uno;
return ret;
}
manda=ret;
manda+=dos;
if(press(manda)==N){
ret+=dos;
return ret;
}
ret+=tres;
return ret;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |