제출 #683102

#제출 시각아이디문제언어결과실행 시간메모리
683102bebra콤보 (IOI18_combo)C++17
30 / 100
69 ms556 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; #define dbg(x) cerr << #x << ": " << x << endl; const char chars[] = {'A', 'B', 'X', 'Y'}; int press(string p); string guess_sequence(int n) { char first_char; if (press("AB")) { if (press("A")) { first_char = 'A'; } else { first_char = 'B'; } } else { if (press("X")) { first_char = 'X'; } else { first_char = 'Y'; } } string good; for (auto c : chars) { if (c != first_char) good += c; } mt19937 rnd(1337); string res = string(1, first_char); for (int i = 1; i < n; ++i) { string curr = res; curr.resize(n, first_char); curr += curr; curr += curr; curr[i] = good[0]; curr[i + n] = good[1]; curr[i + 2 * n] = good[2]; if (press(curr.substr(0, 2 * n)) == i + 1) { if (press(curr.substr(0, n)) == i + 1) { res += good[0]; } else { res += good[1]; } } else { res += good[2]; } } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...