Submission #1311449

#TimeUsernameProblemLanguageResultExecution timeMemory
1311449nataliaaCombo (IOI18_combo)C++20
0 / 100
1 ms400 KiB
#include "combo.h" #include<bits/stdc++.h> using namespace std; string guess_sequence(int N) { int x; string s; char c='C'; x = press("A"); if(x==1) c='A'; x = press("X"); if(x==1) c = 'X'; x = press("Y"); if(x==1) c = 'Y'; if(c=='C') c= 'B'; s+=c; for(int i = 1; i < N-1; i++){ string st[4] = {s, s, s, s}; st[0]+='B'; st[1]+="XX"; st[2]+="XY"; st[3]+="XB"; x = press(st[0]+st[1]+st[2]+st[3]); if(x==i) s+='Y'; if(x==i+1) s+='B'; if(x==i+2) s+='X'; } if(c=='A'){ x = press(s+'B'); if(x==N) s+='B'; else { x = press(s+'X'); if(x==N) s+='X'; else s+='Y'; } } if(c=='B'){ x = press(s+'A'); if(x==N) s+='A'; else { x = press(s+'X'); if(x==N) s+='X'; else s+='Y'; } } if(c=='X'){ x = press(s+'B'); if(x==N) s+='B'; else { x = press(s+'A'); if(x==N) s+='A'; else s+='Y'; } } if(c=='Y'){ x = press(s+'B'); if(x==N) s+='B'; else { x = press(s+'X'); if(x==N) s+='X'; else s+='A'; } } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...