Submission #592122

#TimeUsernameProblemLanguageResultExecution timeMemory
592122JJAnawatCombo (IOI18_combo)C++14
0 / 100
1 ms208 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; string button[4]={"A","B","X","Y"}; string guess_sequence(int N){ string ans=""; if(press("AB")){ ans=(press("A"))?"A":"B"; } else{ ans=(press("X"))?"X":"Y"; } if(N==1) return ans; vector<string> rd; for(int i=0;i<4;i++){ if(button[i]!=ans) rd.push_back(button[i]); } for(int i=1;i<N;i++){ int scr=press(ans+rd[0]+ans+rd[1]+rd[0]+ans+rd[1]+rd[1]+ans+rd[1]+rd[2]); //AB AXB AXY AXZ //else AY int sz=ans.size(); if(scr==sz+1) ans+=rd[0]; else if(scr==sz+2) ans+=rd[1]; else ans+=rd[2]; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...