Submission #1018403

#TimeUsernameProblemLanguageResultExecution timeMemory
1018403efishelCombo (IOI18_combo)C++17
100 / 100
26 ms1868 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; using ll = long long; using vll = vector <ll>; string guess_sequence (int n) { string good = "", oths; if (press("AB") > 0) { if (press("A") > 0) good = "A", oths = "BXY"; else good = "B", oths = "AXY"; } else { if (press("X") > 0) good = "X", oths = "ABY"; else good = "Y", oths = "ABX"; } if (n == 1) return good; for (ll i = 1; i < n-1; i++) { ll ans = press(good+oths[0]+good+oths[1]+oths[0]+good+oths[1]+oths[1]+good+oths[1]+oths[2]); if (ans == i) { good += oths[2]; } else if (ans == i+1) { good += oths[0]; } else if (ans == i+2) { good += oths[1]; } else assert(false); } if (press(good+oths[0]+good+oths[1]) == n) { if (press(good+oths[0]) == n) good += oths[0]; else good += oths[1]; } else { good += oths[2]; } return good; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...