제출 #310854

#제출 시각아이디문제언어결과실행 시간메모리
310854skippre콤보 (IOI18_combo)C++14
30 / 100
48 ms444 KiB
/* res: 30 / 100 sub1: 5 / 5 sub2: 25 / 95 */ #include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { char a, b, x, y; if(press("XY")) { x='A'; y='B'; press("X") ? (a='X', b='Y') : (a='Y', b='X'); } else { x='X'; y='Y'; press("A") ? (a='A', b='B') : (a='B', b='A'); } string ans=""; ans+=a; if(N==1) return ans; for(int i=1; i<=N-1; i++) { if(press(ans+b)==i+1) ans+=b; else if(press(ans+x)==i+1) ans+=x; else ans+=y; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...