# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
879136 | spetar76 | Combo (IOI18_combo) | C++17 | 14 ms | 1848 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"
using namespace std;
std::string guess_sequence(int N) {
string S="";
string ne="QWE";
int qwqw=press("AB");
if (qwqw>0){
int qwerty=press("A");
if (qwerty==1){
S="A";
ne="BXY";
}
else{
S="B";
ne="AXY";
}
}
else{
int qwerty=press("X");
if (qwerty==1){
S="X";
ne="ABY";
}
else{
S="Y";
ne="ABX";
}
}
if (N==1){return S;}
else if (N==2){
if (press(S+ne[0])==2){return S+ne[0];}
else if (press(S+ne[1])==2){return S+ne[1];}
else{return S+ne[2];}
}
for (int i=2; i<=N-1; ++i){
int g=press(S+ne[2]+ne[0] + S+ne[2]+ne[1] + S+ne[2]+ne[2] + S+ne[1]);
S=S+ne[g-S.length()];
}
int gg=press(S+ne[2]);
if (gg==S.length()+1){return S+ne[2];}
gg=press(S+ne[1]);
if (gg==S.length()+1){return S+ne[1];}
return S+ne[0];
return S;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |