제출 #784859

#제출 시각아이디문제언어결과실행 시간메모리
784859omero콤보 (IOI18_combo)C++14
5 / 100
1 ms256 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 = ""; int x=0; if(press("AB")){ if(press("A")){ S += s[0]; x=0; } else{ S += s[1]; x=1; } } else{ if(press("X")){ S += s[2]; x=2; } else{ S += s[3]; x=3; } } A += S[(int)S.size()-1]; for(int i=0;i<4;i++){ if(i != x){ t += s[i]; } } 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...