제출 #963835

#제출 시각아이디문제언어결과실행 시간메모리
963835Hezov콤보 (IOI18_combo)C++17
100 / 100
16 ms2028 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { string s; char a,b,c,d; if(press("AB")) { c = 'X' , d = 'Y'; if(press("A")) a = 'A' , b = 'B'; else a = 'B' , b = 'A'; } else { c = 'A' , d = 'B'; if(press("X")) a = 'X' , b = 'Y'; else a = 'Y' , b = 'X'; } s+=a; if(N==1) return s; for(int i = 1;i<N-1;i++) { int k = press(s+b+b+s+b+c+s+b+d+s+c); if(k==i) s+=d; if(k==i+1) s+=c; if(k==i+2) s+=b; } if(press(s+b)==N) s+=b; else if(press(s+c)==N) s+=c; else s+=d; return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...