# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
304369 | ecnerwala | Counting Mushrooms (IOI20_mushrooms) | C++17 | 3069 ms | 90580 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "mushrooms.h"
#include <bits/stdc++.h>
namespace {
enum class MOVE_TYPE {
NONE,
AxAx,
AxAxAxAx,
xAx_xBx,
};
std::pair<int, MOVE_TYPE> get_max_cnt(int ka, int kb, int q) {
if (q == 0) return {0, MOVE_TYPE::AxAxAxAx};
if (ka < kb) std::swap(ka, kb);
assert(ka >= kb);
static std::map<std::tuple<int, int, int>, std::pair<int, MOVE_TYPE>> mem;
auto it = mem.find({ka, kb, q});
if (it != mem.end()) return it->second;
std::pair<int, MOVE_TYPE> ans = {0, MOVE_TYPE::AxAxAxAx};
// AxAx
if (ka >= 2 || kb >= 2) {
ans = std::max(ans,
{
2 + std::min({
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |