Submission #555441

#TimeUsernameProblemLanguageResultExecution timeMemory
555441PietraCombo (IOI18_combo)C++14
0 / 100
17 ms348 KiB
#include "combo.h" #include<bits/stdc++.h> using namespace std ; string guess_sequence(int N) { vector<string> s = {"A", "B", "X", "Y"} ; string 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[1] + ans + s[2] + s[2] + ans + s[2] + s[3] + ans + s[2] + s[1]) ; if(tam == i - 1) ans += s[3] ; if(tam == i) ans += s[1] ; else ans += s[2] ; } 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...