# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
357732 | KoD | Cats or Dogs (JOI18_catdog) | C++17 | 627 ms | 27392 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 "catdog.h"
#include <vector>
#include <algorithm>
#include <utility>
#include <array>
namespace Solver {
template <class T>
using Vec = std::vector<T>;
constexpr int MAX = 100000;
struct Monoid {
static constexpr Monoid ID() { return Monoid { { 0, MAX, MAX, 0 } }; }
std::array<std::array<long long, 2>, 2> value;
Monoid operator + (const Monoid &other) const {
Monoid ret{ { MAX, MAX, MAX, MAX }};
for (int i: { 0, 1 }) {
for (int j: { 0, 1 }) {
for (int k: { 0, 1 }) {
for (int l: { 0, 1 }) {
ret.value[i][l] = std::min(ret.value[i][l], value[i][j] + other.value[k][l] + (j ^ k));
}
}
}
}
return ret;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |