제출 #145040

#제출 시각아이디문제언어결과실행 시간메모리
145040mhy908콤보 (IOI18_combo)C++14
100 / 100
63 ms464 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; typedef long long LL; string qu; char c[10]; string guess_sequence(int n) { if(press(qu+'A'+'B')){ if(press(qu+'A'))qu+='A', c[1]='B', c[2]='X', c[3]='Y'; else qu+='B', c[1]='A', c[2]='X', c[3]='Y'; } else{ if(press(qu+'X'))qu+='X', c[1]='B', c[2]='A', c[3]='Y'; else qu+='Y', c[1]='B', c[2]='X', c[3]='A'; } for(int i=2; i<n; i++){ int temp=press(qu+c[1]+c[1]+qu+c[1]+c[2]+qu+c[1]+c[3]+qu+c[2]); if(temp==i+1)qu+=c[1]; if(temp==i)qu+=c[2]; if(temp==i-1)qu+=c[3]; } if(n!=1){ if(press(qu+c[1])==n)qu+=c[1]; else if(press(qu+c[2])==n)qu+=c[2]; else qu+=c[3]; } return qu; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...