제출 #240250

#제출 시각아이디문제언어결과실행 시간메모리
240250Masterdan콤보 (IOI18_combo)C++14
100 / 100
39 ms572 KiB
#include "combo.h" using namespace std; string guess_sequence(int N) { string p, q, r; string S; if(press("AB")){ if(press("A")) S="A", p="B", q="X", r="Y"; else p="A", S="B", q="X", r="Y"; } else{ if(press("X")) p="A", q="B", S="X", r="Y"; else p="A", q="B", r="X", S="Y"; } if(N==1)return S; for(int i=1;i<N-1;i++){ int letra=press(S+p+p+S+p+q+S+p+r+S+q); if (letra==i)S+=r; if (letra==i+1)S+=q; if (letra==i+2)S+=p; } if(press(S+p)==N)return S+p; if(press(S+q)==N)return S+q; return S+r; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...