Submission #137260

#TimeUsernameProblemLanguageResultExecution timeMemory
137260AKaan37Combo (IOI18_combo)C++17
100 / 100
65 ms500 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; #define pb push_back std::string guess_sequence(int n) { char ilk; vector<char> v; string s; s+='A'; s+='B'; int para = press(s); if(para==1 || para==2){ s.clear(); s+='A'; para=press(s); if(para==1)ilk='A'; else ilk='B'; } else{ s.clear(); s+='X'; para=press(s); if(para==1)ilk='X'; else ilk='Y'; } if(ilk!='X')v.pb('X'); if(ilk!='Y')v.pb('Y'); if(ilk!='A')v.pb('A'); if(ilk!='B')v.pb('B'); string S; S=ilk; for(int i=2;i<n;i++){ s.clear(); s=S; s+=v[0]; s+=S; s+=v[1]; s+=v[0]; s+=S; s+=v[1]; s+=v[1]; s+=S; s+=v[1]; s+=v[2]; para=press(s); if(para==i-1)S+=v[2]; else if(para==i)S+=v[0]; else{ S+=v[1]; } } if(n>1){ s.clear(); s=S; s+=v[0]; s+=S; s+=v[1]; para=press(s); if(para==n){ s.clear(); s=S; s+=v[0]; para=press(s); if(para==n){S+=v[0];} else S+=v[1]; } else S+=v[2]; } return S; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...