Submission #1029293

#TimeUsernameProblemLanguageResultExecution timeMemory
1029293biserailievaCombo (IOI18_combo)C++14
100 / 100
21 ms1812 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; typedef long long ll; std::string guess_sequence(int N) { string s, t; if(press(s+'A'+s+'B')>=1) { if(press(s+'A')>=1){ s+='A'; t="BXY"; } else{ s+='B'; t="AXY"; } } else{ if(press(s+'X')>=1){ s+='X'; t="ABY"; } else{ s+='Y'; t="ABX"; } } if(N==1) return s; for(ll i=1; i<N-1; i++){ ll ans=press(s+t[0]+s+t[1]+t[0]+s+t[1]+t[1]+s+t[1]+t[2]); if(ans==i) s+=t[2]; else if(ans==i+1) s+=t[0]; else s+=t[1]; } if(press(s+t[0]+s+t[1])>=N) { if(press(s+t[0])>=N){ s+=t[0]; } else{ s+=t[1]; } } else{ s+=t[2]; } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...