제출 #404343

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