제출 #1105383

#제출 시각아이디문제언어결과실행 시간메모리
1105383lkateris콤보 (IOI18_combo)C++17
0 / 100
1 ms336 KiB
#include <iostream> #include <string> #include "combo.h" using namespace std; string guess_sequence(int N) { string S = ""; string s1 = ""; string s2 = ""; string s3 = ""; string s4 = ""; if (press("AB") > 0) { if (press("B") > 0) { S[0] = 'B'; s1 = "XA"; } else { S[0] = 'A'; s1 = "XB"; } s2 = "XY"; s3 = "XX"; s4 = "Y"; } else { if (press("X") > 0) { S[0] = 'X'; s1 = "AY"; } else { S[0] = 'Y'; s1 = "AX"; } s2 = "AB"; s3 = "AA"; s4 = "B"; } int cnt = 1; for(int i=1;i<N-1;++i) { int c = press(S + s1 + S + s2 + S + s3 + S + s4); if (c - cnt == 2) S += s1[0]; else if (c - cnt == 1) S += s4[0]; cnt++; } if (press(S + 'A' + S + 'B') > cnt) { if (press(S + 'A') > cnt) { S += 'A'; return S; } else { S += 'B'; return S; } } else { if (press(S + "X") > cnt) { S += 'X'; return S; } else { S += 'Y'; return S; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...