제출 #322081

#제출 시각아이디문제언어결과실행 시간메모리
322081kwongweng콤보 (IOI18_combo)C++14
5 / 100
1 ms256 KiB
#include <bits/stdc++.h> #include "combo.h"; using namespace std; string guess_sequence(int n){ string S = ""; int a = press("AB"); if (a >= 1){ int b = press("A"); if (b == 1){ S += "A"; }else{ S += "B"; } }else{ int b = press("X"); if (b == 1) S += "X"; else S += "Y"; } string c = "ABXY"; string ch = ""; for (int i = 0; i < 4; i++){ if (c[i] == S[0]) continue; ch += c[i]; } for (int i = 1; i < n-1; i++){ string ask = S + ch[0] + ch[0] + S + ch[0] + ch[1] + S + ch[0] + ch[2] + S + ch[1]; int b = press(ask); if (b == i) S += ch[2]; else if (b == i+1) S += ch[1]; else S += ch[0]; } int b = press(S + ch[0]); if (b == n) return S + ch[0]; else{ int d = press(S + ch[1]); if (d == n) return S + ch[1]; else return S + ch[2]; } }

컴파일 시 표준 에러 (stderr) 메시지

combo.cpp:2:19: warning: extra tokens at end of #include directive
    2 | #include "combo.h";
      |                   ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...