# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
315514 | Flugan42 | Combo (IOI18_combo) | C++14 | 0 ms | 0 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.
def guess_sequence(N, press):
ans = press("AB")
fst = ""
if ans:
ans = press("A")
if ans:
fst = "A"
else:
fst = "B"
else:
ans = press("X")
if ans:
fst = "X"
else:
fst = "Y"
other = []
for tmp in "ABXY":
if tmp != fst:
other.append(tmp)
S = fst
for i in range(1,N-1):
ans = press(S+other[0]+other[0]+S+other[0]+other[1]+S+other[0]+other[2]+S+other[1])
if ans == i+2:
S += other[0]
elif ans == i+1:
S += other[1]
else:
S += other[2]
ans = press(S+other[0])
if ans == N:
return S+other[0]
ans = press(S+other[1])
if ans == N:
return S+other[1]
return S+other[2]