# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
146405 | aanji | Combo (IOI18_combo) | C++14 | 46 ms | 556 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 s;
string a="A", b="B", c="X";
if(press("AB")) {
if(press("A")) {
s="A";
a="Y";
}
else {
b="Y";
s="B";
}
}
else {
if(press("X")) {
c="Y";
s="X";
}
else s="Y";
}
for(int i=2;i<N;i++) {
int k=press(s+a+s+b+a+s+b+b+s+b+c);
if(k==i) s+=a;
else if(k==i+1) s+=b;
else s+=c;
}
if(N>1) {
if(press(s+a)==s.size()+1) return s+a;
if(press(s+b)==s.size()+1) return s+b;
return s+c;
}
return s;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |