제출 #867783

#제출 시각아이디문제언어결과실행 시간메모리
867783lalig777콤보 (IOI18_combo)C++14
100 / 100
14 ms1784 KiB
#include "combo.h" #include <iostream> #include <vector> using namespace std; string guess_sequence(int N){ string S=""; char l1='A', l2='B', l3='X'; if (press("AB")>=1){ if (press("A")==1){ S+='A'; l1='Y'; }else{ S+='B'; l2='Y'; } }else{ if (press("X")==1){ S+='X'; l3='Y'; }else S+='Y'; }for (int i=1; i<N; i++){ string p=""; if (i==N-1){ if (press(S+l1)==N) S+=l1; else if (press(S+l2)==N) S+=l2; else S+=l3; break; }p=S+l1+l1+S+l1+l2+S+l1+l3+S+l2; int x=press(p); if (x==i) S+=l3; else if (x==i+1) S+=l2; else S+=l1; } return S; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...