Submission #1026094

#TimeUsernameProblemLanguageResultExecution timeMemory
1026094marizaCombo (IOI18_combo)C++14
5 / 100
1 ms344 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"; } } 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+'A'+s+'B')>=N) { if(press(s+'A')>=N){ s+='A'; } else{ s+='B'; } } else{ if(press(s+'X')>=N){ s+='X'; } else{ s+='Y'; } } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...