Submission #1128601

#TimeUsernameProblemLanguageResultExecution timeMemory
1128601MathiasCombo (IOI18_combo)C++20
0 / 100
0 ms408 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { string p="", ans=""; int x; p="AB"; x=press(p); if(x==0){ p="X", x=press(p); if(x==0) ans="Y"; else ans="X"; } else{ p="A", x=press(p); if(x==0) ans="B"; else ans="A"; } for(int i=2;i<=N;i++){ if(ans[0]=='A'){ p=ans+"B"+ans+"XY"+ans+"XX"+ans+"XB", x=press(p); if(x==0) ans+="Y"; else if(x==1) ans+="B"; else ans+="X"; } else if(ans[0]=='X'){ p=ans+"B"+ans+"AY"+ans+"AB"+ans+"AA", x=press(p); if(x==0) ans+="Y"; else if(x==1) ans+="B"; else ans+="A"; } else if(ans[0]=='B'){ p=ans+"Y"+ans+"XY"+ans+"XX"+ans+"XB", x=press(p); if(x==0) ans+="A"; else if(x==1) ans+="Y"; else ans+="X"; } else if(ans[0]=='Y'){ p=ans+"B"+ans+"XA"+ans+"XX"+ans+"XB", x=press(p); if(x==0) ans+="A"; else if(x==1) ans+="B"; else ans+="X"; } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...