제출 #349485

#제출 시각아이디문제언어결과실행 시간메모리
349485David_M콤보 (IOI18_combo)C++14
100 / 100
44 ms556 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string ans; char c, a[]={'Y', 'A', 'B'}; string guess_sequence(int N){ if(press("XY")){ if(press("X"))ans+='X'; else ans+='Y'; }else{ if(press("A"))ans+='A'; else ans+='B'; } if(N==1)return ans; if(ans=="Y")a[0]='X'; if(ans=="A")a[1]='X'; if(ans=="B")a[2]='X'; for (int i=1; i<N-1; i++)ans+=a[press(ans+a[1]+ans+a[2]+a[0]+ans+a[2]+a[1]+ans+a[2]+a[2])-i]; if(press(ans+a[0])==N)return ans+a[0]; if(press(ans+a[1])==N)return ans+a[1]; return ans+a[2]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...