Submission #729439

#TimeUsernameProblemLanguageResultExecution timeMemory
729439t6twotwo콤보 (IOI18_combo)C++17
5 / 100
1 ms276 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string T[4] = {"A", "B", "X", "Y"}; string guess_sequence(int N) { int p = -1; int a = press(T[0] + T[1]); int b = press(T[2] + T[3]); int c = press(T[0] + T[2]); int d = press(T[1] + T[3]); if (a && c) { p = 0; } else if (a && d) { p = 1; } else if (b && c) { p = 2; } else { p = 3; } string ans = T[p]; vector<string> S; for (int i = 0; i < 4; i++) { if (i != p) { S.push_back(T[i]); } } for (int i = 1; i < N - 1; i++) { string s = ans + S[0] + ans + S[1] + S[0] + ans + S[1] + S[1] + ans + S[1] + S[2]; int v = press(s); if (v == i + 2) { ans = ans + S[1]; } else if (v == i + 1) { ans = ans + S[0]; } else { ans = ans + S[2]; } } if (press(ans + S[0]) == N) { ans = ans + S[0]; } else if (press(ans + S[1]) == N) { ans = ans + S[1]; } else { ans = ans + S[2]; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...