제출 #800029

#제출 시각아이디문제언어결과실행 시간메모리
800029VadimK콤보 (IOI18_combo)C++17
5 / 100
1 ms292 KiB
#include <bits/stdc++.h> using namespace std; int press(string p); string guess_sequence(int N) { string s; int f=press("AB"); if (f==0) { if (press("X")==0) s="Y"; else s="X"; } else { if (press("A")==0) s="B"; else s="A"; } if (s[0]=='A') for (int i=1; i<N-1; i++) { int check=press(s+"B"+s+"XB"+s+"XX"+s+"XY"); if (check==i) s+='Y'; else if (check==i+1) s+='B'; else s+="X"; } else if (s[0]=='B') for (int i=1; i<N-1; i++) { int check=press(s+"A"+s+"XA"+s+"XX"+s+"XY"); if (check==i) s+='Y'; else if (check==i+1) s+='A'; else s+="X"; } else if (s[0]=='X') for (int i=1; i<N-1; i++) { int check=press(s+"A"+s+"BA"+s+"BB"+s+"BY"); if (check==i) s+='Y'; else if (check==i+1) s+='A'; else s+="B"; } else for (int i=1; i<N-1; i++) { int check=press(s+"A"+s+"BA"+s+"BB"+s+"BX"); if (check==i) s+='X'; else if (check==i+1) s+='A'; else s+="B"; } int l=press(s+"A"+s+"B"); if (l<N) { if (press(s+"X")<N) s+="Y"; else s+="X"; } else { if (press(s+"A")<N) s+="B"; else s+="A"; } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...