제출 #228163

#제출 시각아이디문제언어결과실행 시간메모리
228163blacktulip콤보 (IOI18_combo)C++17
100 / 100
38 ms584 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...