# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
76695 | thebes | Combo (IOI18_combo) | C++14 | 84 ms | 696 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;
string s, t, idk;
string guess_sequence(int N){
if(press("AB")){
if(press("A")) s = "A", idk="BXY";
else s = "B", idk="AXY";
}
else{
if(press("X")) s = "X", idk="ABY";
else s = "Y", idk="ABX";
}
if(N==1) return s;
for(int i=2;i<N;i++){
t = s+idk[0]+s+idk[1]+idk[0]+s+idk[1]+idk[1]+s+idk[1]+idk[2];
assert(t.size() <= 4*N);
int m = press(t);
if(m == i-1) s += idk[2];
else if(m == i) s += idk[0];
else s += idk[1];
}
int a = press(s+idk[0]), b = press(s+idk[1]);
if(a != N-1) s += idk[0];
else if(b != N-1) s += idk[1];
else s += idk[2];
return s;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |