Submission #315514

#TimeUsernameProblemLanguageResultExecution timeMemory
315514Flugan42Combo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
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]

Compilation message (stderr)

combo.cpp:1:1: error: 'def' does not name a type
    1 | def guess_sequence(N, press):
      | ^~~