제출 #592130

#제출 시각아이디문제언어결과실행 시간메모리
592130ttamx콤보 (IOI18_combo)C++14
100 / 100
30 ms792 KiB
#include "combo.h" using namespace std; string guess_sequence(int N){ char cc[4]= {'A','B','X','Y'}; char c[3]; string S=""; if(press("AB")){ if(press("A"))S="A"; else S="B"; }else{ if(press("X"))S="X"; else S="Y"; } int cnt=0; for(int i=0;i<4;++i){ if(cc[i]==S[0])continue; c[cnt++]=cc[i]; } if(N==1)return S; for (int i = 1; i < N-1; ++i){ string tmp=S+c[1]; for(int j=0;j<3;++j){ tmp+=S+c[2]+c[j]; } S+=c[press(tmp)-i]; } if(press(S+"A"+S+"B")==N){ if(press(S+"A")==N)S+="A"; else S+="B"; }else{ if(press(S+"X")==N)S+="X"; else S+="Y"; } return S; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...