제출 #555443

#제출 시각아이디문제언어결과실행 시간메모리
555443Pietra콤보 (IOI18_combo)C++14
100 / 100
27 ms632 KiB
#include "combo.h" #include<bits/stdc++.h> using namespace std ; string s[4] = {"A", "B", "X", "Y"} ; string ans ; string guess_sequence(int N) { if(!N) return ans ; if(press(s[0]+s[1])){ if(press(s[1])) swap(s[0], s[1]) ; } else if(press(s[2])) swap(s[0], s[2]) ; else swap(s[0], s[3]) ; ans = s[0] ; if(N == 1) return ans ; for(int i = 2 ; i < N ; i++){ int tam = press(ans+s[2]+ans+s[3]+s[1]+ans+s[3]+s[2]+ans+s[3]+s[3]) ; if(tam == i - 1) ans += s[1] ; else if(tam == i) ans += s[2] ; else ans += s[3] ; } if(press(ans + s[1]) == N) ans += s[1] ; else if(press(ans + s[2]) == N) ans += s[2] ; else ans += s[3] ; return ans ; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...