Submission #234149

#TimeUsernameProblemLanguageResultExecution timeMemory
234149BinyominCombo (IOI18_combo)C++14
30 / 100
63 ms592 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std ; string guess_sequence(int N) { vector < string > s, a = { "A", "B", "X", "Y"} ; string ans = "", p = ""; int cnt = 1, cc; if( press("AB") ) { if( press("A") ) { ans ="A"; s = { "B", "X", "Y"} ; } else { ans ="B"; s = {"A", "X", "Y" }; } } else { if( press("X") ) { ans ="X"; s = {"A", "B", "Y"}; } else{ ans ="Y"; s = {"A", "B", "X"}; } } while( cnt != N ) { p = ans + s[0] + ans + s[1] ; cc = press(p) ; if( cc > cnt ) { p = ans + s[0] ; cc = press(p) ; if( cc > cnt ) ans += s[0] ; else ans += s[1] ; cnt ++ ; } else { ans += s[2] ; cnt ++ ; } } return ans ; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...