Submission #555442

#TimeUsernameProblemLanguageResultExecution timeMemory
555442PietraCombo (IOI18_combo)C++14
0 / 100
21 ms352 KiB
#include "combo.h" #include<bits/stdc++.h> using namespace std ; string guess_sequence(int N) { string s[4] = {"A", "B", "X", "Y"} ; string ans = "" ; 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] ; 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...