Submission #75472

#TimeUsernameProblemLanguageResultExecution timeMemory
75472sevenkplusCombo (IOI18_combo)C++14
100 / 100
62 ms640 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> PII; #define fi first #define se second #define pb push_back #define mp make_pair #define pct __builtin_popcount #define INF 1000000007 std::string guess_sequence(int N) { string p = ""; if (press("AB")) { if (press("A")) p = "A"; else p = "B"; } else { if (press("X")) p = "X"; else p = "Y"; } if (N == 1) return p; string s = ""; for (char c : "ABXY") if (p[0] != c) s += c; for (int i = 1; i < N-1; i ++) { int c = press(p+s[0]+s[0] + p+s[0]+s[1] + p+s[0]+s[2] + p+s[1]); if (c == i+2) p += s[0]; if (c == i+1) p += s[1]; if (c == i) p += s[2]; } if (press(p+s[0]) == N) p += s[0]; else if (press(p+s[1]) == N) p += s[1]; else p += s[2]; return p; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...