# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1169582 | sleepntsheep | Cats or Dogs (JOI18_catdog) | C++17 | 3095 ms | 14896 KiB |
#include "catdog.h"
#include <cstdio>
#include <vector>
#include <algorithm>
#define N 111111
struct Mat{
long long a[4]={0};
friend Mat operator*(const Mat &a, const Mat &b) {
Mat c;
c.a[0] = std::min(a.a[0] + b.a[0], a.a[1] + b.a[2]);
c.a[1] = std::min(a.a[0] + b.a[1], a.a[1] + b.a[3]);
c.a[2] = std::min(a.a[2] + b.a[0], a.a[3] + b.a[2]);
c.a[3] = std::min(a.a[2] + b.a[1], a.a[3] + b.a[3]);
return c;
}
void pt() {
}
friend Mat operator-(const Mat &a, const Mat &b) {
Mat c;
for (int j=0;j<4;++j)
c.a[j] = a.a[j] - b.a[j];
return c;
}
friend Mat operator+(const Mat &a, const Mat &b) {
Mat c;
for (int j=0;j<4;++j)
c.a[j] = a.a[j] + b.a[j];
return c;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |