제출 #144248

#제출 시각아이디문제언어결과실행 시간메모리
144248josiftepe콤보 (IOI18_combo)C++14
0 / 100
1 ms200 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; std::string guess_sequence(int N) { vector<char> seq={'A','B','X','Y'}; string s = ""; int ab=press("AB"); if(ab==1) { int aa=press("A"); if(aa==1) { s+='A'; } else { s+='B'; } } else { int xx=press("X"); if(xx==1) { s+='X'; } else { s+='Y'; } } if(s[0] == 'A'){ seq.erase(seq.begin()); } else if(s[0] == 'B'){ seq.erase(seq.begin() + 1); } else if(s[0] == 'X'){ seq.erase(seq.begin() + 2); } else{ seq.erase(seq.begin() + 3); } while((int)s.size()<N) { string prv=s+seq[0]; string vtor=s+seq[1]+seq[2]; string tret=s+seq[1]+seq[1]; string cet=s+seq[1]+seq[0]; string tmp = ""; tmp += prv; tmp += vtor; tmp += tret; tmp += cet; int nxt=press(tmp); if(nxt==1+(int)s.size())s+=seq[0]; else if(nxt==2+(int)s.size())s+=seq[1]; else s+=seq[2]; } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...