# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
501332 | shantol | 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 guess_sequence(int N){
string a;
char x,y,z;
for(int i=0;i<N;i++){
if(i==0){
if(press("AB")){
if(press("A")){
a="A";
x='B';
y='X';
z='Y';
}
else {
a="B";
x='A';
y='X';
z='Y';
}
}
else if(press("X")){
a="X";
x='B';
y='A';
z='Y';
}
else {
a="Y";
x='B';
y='X';
z='A';
}
}
else if(i==N-1){
if(press(a+x)){a+=x;}
else if(press(a+y)){a+=y;}
else {a+=z;}
}
else{
int p=press(a+x+x+a+x+y+a+x+z+a+y);
if(p==2){a+=x;}
else if(p==1){a+=y;}
else {a+=z;}
}
}
return a;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |