# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1172493 | versesrev | Combo (IOI18_combo) | C++20 | 0 ms | 400 KiB |
// 17:31
#include <string>
#include <vector>
#include <functional>
#include <cassert>
#include "combo.h"
std::string guess_sequence (int N) {
return {};
std::vector<char> cs{'a', 'b', 'x', 'y'};
char start = std::invoke([&]{
int v1 = press("ab");
if (v1 == 1) {
if (press("a") == 1) return 'a';
else return 'b';
}
else {
if (press("x") == 1) return 'x';
else return 'y';
}
});
std::erase(cs, start);
std::string ans;
ans += start;
for (int i = 1; i < N - 1; ++i) {
std::string query = ans + cs[0];
query += ans + cs[1] + cs[0];
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |