제출 #206155

#제출 시각아이디문제언어결과실행 시간메모리
206155oko콤보 (IOI18_combo)C++14
5 / 100
1411 ms2024 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { string s="ABXY",ans; if(press("AB")) { if(press("A")) { ans+='A'; s="BXY"; } else { ans+='B'; s="AXY"; } } else { if(press("X")) { ans+='X'; s="ABY"; } else { ans+='Y'; s="ABX"; } } for(int i=2; i<=N; i++) { if(i==N) { string ask=ans+s[0],ask1=ans+s[1]; if(press(ask)==N)ans=ask; else if(press(ask1)==N)ans=ask1; else ans+=s[2]; break; } string ask; ask+=ans; ask+=s[0]; ask+=ans; ask+=s[1]; ask+=s[1]; ask+=ans; ask+=s[1]; ask+=s[0]; ask+=ans; ask+=s[1]; ask+=s[2]; int k=press(ask); if(k==i)ans+=s[0]; else if(k==i+1)ans+=s[1]; else ans+=s[2]; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...