제출 #298879

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