Submission #369797

#TimeUsernameProblemLanguageResultExecution timeMemory
369797flappybirdCombo (IOI18_combo)C++14
100 / 100
46 ms808 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; std::string guess_sequence(int N) { char a, b, c, d; if (press("AB")) { if (press("A")) { a = 'A'; b = 'B'; c = 'X'; d = 'Y'; } else { a = 'B'; b = 'A'; c = 'X'; d = 'Y'; } } else { if (press("X")) { a = 'X'; b = 'B'; c = 'A'; d = 'Y'; } else { a = 'Y'; b = 'B'; c = 'X'; d = 'A'; } } int i; string S; S += a; if (N == 1) return S; for (i = 2; i <= N - 1; i++) { string g1, g2, g3, g4; string g; g = S + b; g1 = g + b; g2 = g + c; g3 = g + d; g4 = S + c; int res = press(g1 + g2 + g3 + g4); if (res == i + 1) S += b; if (res == i) S += c; if (res == i - 1) S += d; } if (press(S + b) == N) return S + b; if (press(S + c) == N) return S + c; return S + d; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...