제출 #485721

#제출 시각아이디문제언어결과실행 시간메모리
485721dongliu0426콤보 (IOI18_combo)C++17
100 / 100
44 ms532 KiB
#include "combo.h" using namespace std; string guess_sequence(int N) { string s, c0, c1, c2; if (press("AB")) { if (press("A")) s = "A", c0 = "B", c1 = "X", c2 = "Y"; else s = "B", c0 = "A", c1 = "X", c2 = "Y"; } else { if (press("X")) s = "X", c0 = "A", c1 = "B", c2 = "Y"; else s = "Y", c0 = "A", c1 = "B", c2 = "X"; } for (int i = 1; i + 1 < N; i++) { int k = press(s + c0 + s + c1 + c0 + s + c1 + c1 + s + c1 + c2) - (int) s.size(); if (k == 0) s += c2; else if (k == 1) s += c0; else s += c1; } if (N > 1) { if (press(s + c0) == N) s += c0; else if (press(s + c1) == N) s += c1; else s += c2; } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...