제출 #476347

#제출 시각아이디문제언어결과실행 시간메모리
476347ponytail콤보 (IOI18_combo)C++17
0 / 100
0 ms200 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; std::string guess_sequence(int N) { string S; if(press("A")) { S += "A"; } else if(press("B")) { S += "B"; } else if(press("X")) { S += "X"; } else { S += "Y"; } string W = "ABXY", T; for(int i=0; i<4; i++) { if(S[0] != W[i]) T += W[i]; } for(int i=1; i<N-1; i++) { string one = S + T[0]; string q; for(int j=0; j<3; j++) { q += one; q += T[j]; } q += S; q += T[1]; q += S[0]; int res = press(q); if(res == i + 2) S += T[0]; else if(res == i + 1) S += T[1]; else S += T[2]; } if(press(S + T[0]) == N) S += T[0]; else if(press(S + T[1]) == N) S += T[1]; else S += T[2]; cout << S << "\n"; return S; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...