제출 #784862

#제출 시각아이디문제언어결과실행 시간메모리
784862omero콤보 (IOI18_combo)C++14
100 / 100
28 ms536 KiB
#include "combo.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; std::string guess_sequence(int N) { string s = "ABXY"; string S = ""; string t = ""; string A = ""; if(press("AB")){ if(press("A")){ S += s[0]; } else{ S += s[1]; } } else{ if(press("X")){ S += s[2]; } else{ S += s[3]; } } A += S[(int)S.size()-1]; for(int i=0;i<4;i++){ if(S[(int)S.size()-1] == s[i]){ for(int j=0;j<4;j++){ if(s[j] != s[i]){ t += s[j]; } } } } if(N == 1){ return A; } for(int i=1;i<N-1;i++){ string st = A+t[0]+A+t[1]+t[1]+A+t[1]+t[0]+A+t[1]+t[2]; int p = press(st); A += t[(p-i+2)%3]; } if(press(A+t[0]) == N){ A += t[0]; } else if(press(A+t[1]) == N){ A += t[1]; } else{ A += t[2]; } return A; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...