제출 #440743

#제출 시각아이디문제언어결과실행 시간메모리
440743Aryan_Raina콤보 (IOI18_combo)C++17
100 / 100
29 ms704 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { string A = ""; string T = "ABXY"; int len = press(A + T[0] + A + T[1]); int ind = 2 * (len == 0); ind += (press(A + T[ind]) == 0); A += T[ind]; swap(T[ind], T[3]); for (int i = 1; i < N-1; i++) { len = press(A+T[0]+T[0] + A+T[0]+T[1] + A+T[0]+T[2] + A+T[1]); if (len == i+2) { A += T[0]; } else if (len == i+1) { A += T[1]; } else { A += T[2]; } } if (N > 1) { len = press(A + T[0] + A + T[1]); ind = 2 * (len == N-1); ind += (press(A + T[ind]) == N-1); A += T[ind]; } return A; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...