# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
209664 | TAISA_ | Combo (IOI18_combo) | C++14 | 41 ms | 560 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 <bits/stdc++.h>
using namespace std;
std::string guess_sequence(int N) {
string res="";
string p="AB";
string c;
if(press(p)){
p="A";
if(press(p)){
c="BXY";
res+="A";
}else{
c="AXY";
res+="B";
}
}else{
p="X";
if(press(p)){
c="ABY";
res+="X";
}else{
c="ABX";
res+="Y";
}
}
if(N==1)return res;
for(int i=1;i+1<N;i++){
p="";
int cnt=0;
for(int j=0;j<3;j++){
p+=res+c[0]+c[j];
}
p+=res+c[1];
int r=press(p)-res.length();
if(r==1){
res+=c[1];
}else if(r==2){
res+=c[0];
}else{
res+=c[2];
}
}
p=res+c[0]+res+c[1];
if(press(p)>res.length()){
p=res+c[0];
if(press(p)>res.length()){
res+=c[0];
}else{
res+=c[1];
}
}else{
res+=c[2];
}
return res;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |