Submission #800012

#TimeUsernameProblemLanguageResultExecution timeMemory
800012VadimKCombo (IOI18_combo)C++17
0 / 100
0 ms208 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+"AB"); 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...