제출 #1185801

#제출 시각아이디문제언어결과실행 시간메모리
1185801Mamikonm1콤보 (IOI18_combo)C++20
100 / 100
7 ms484 KiB
#include<bits//stdc++.h> #include "combo.h" using namespace std; string guess_sequence(int N) { string s,t="ABXY"; vector<char>x; if(press("AB")){ if(press("A"))s+='A'; else s+='B'; } else if(press("X"))s+='X'; else s+='Y'; for(char y:t){ if(y!=s[0]){ x.push_back(y); } } int cur; for(int i=2;i<=N;++i){ if(i<N){ cur=press(s+x[0]+s+x[1]+x[1]+s+x[1]+x[2]+s+x[1]+x[0]); if(cur==i)s+=x[0]; else if(cur==i+1)s+=x[1]; else s+=x[2]; } else{ if(press(s+x[0])==i)s+=x[0]; else if(press(s+x[1])==i)s+=x[1]; else s+=x[2]; } } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...