제출 #548557

#제출 시각아이디문제언어결과실행 시간메모리
548557four_specks콤보 (IOI18_combo)C++17
100 / 100
34 ms564 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; namespace { } // namespace string guess_sequence(int N) { string alpha = "ABXY"; char c = press("AB") > 0 ? press("A") ? 'A' : 'B' : press("X") ? 'X' : 'Y'; alpha.erase(alpha.find(c), 1); string res = ""; res += c; for (int i = 1; i < N; i++) { if (i == N - 1) { res += press(res + alpha[0]) == N ? alpha[0] : press(res + alpha[1]) == N ? alpha[1] : alpha[2]; } else { int coins = press(res + alpha[0] + res + alpha[1] + alpha[0] + res + alpha[1] + alpha[1] + res + alpha[1] + alpha[2]); if (coins == i + 2) res += alpha[1]; else if (coins == i + 1) res += alpha[0]; else res += alpha[2]; } } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...