Submission #1084871

#TimeUsernameProblemLanguageResultExecution timeMemory
1084871AliyyiakbarCombo (IOI18_combo)C++17
30 / 100
28 ms956 KiB
#include "bits/stdc++.h" #include "combo.h" using namespace std; string guess_sequence(int n) { string res = ""; set<string>st = {"A","B","X","Y"}; string str = ""; if (press("A")) { res += "A"; st.erase("A"); } else if (press("B")) { res += "B"; st.erase("B"); } else if (press("X")) { res += "X"; st.erase("X"); } else { res += "Y"; st.erase("Y"); } str = *st.begin(); st.erase(st.begin()); bool f = 0; for (int i = 2; i <= n; ++i) { f = 0; for (auto x : st) { if (press(res + x) > i-1) { res += x; f = 1; break; } } if (!f) { res += str; } } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...