제출 #1311553

#제출 시각아이디문제언어결과실행 시간메모리
1311553aleksandre콤보 (IOI18_combo)C++20
30 / 100
12 ms448 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { char k; if (press("AB") > 0) { if (press("B") > 0) k = 'B'; else k = 'A'; } else { if (press("X") > 0) k = 'X'; else k = 'Y'; } vector<char> v; for (char c : {'A','B','X','Y'}) { if (c != k) v.push_back(c); } string S(1, k); for (int i = 1; i < N-1; i++) { int res = press(S + v[0]); if (res == i+1) { S += v[0]; continue; } res = press(S + v[1]); if (res == i+1) { S += v[1]; continue; } S += v[2]; } if (N > 1) { if (press(S + v[0]) == N) { S += v[0]; } else if (press(S + v[1]) == N) { S += v[1]; } else { S += v[2]; } } return S; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...