# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1169229 | sleepntsheep | Cats or Dogs (JOI18_catdog) | C++17 | 2 ms | 2880 KiB |
#include "catdog.h"
#include <cstdio>
#include <vector>
#include <algorithm>
#define N 111111
int col[N];
struct Mat{
long long a[4];
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() {
return ;
printf(" [ %d %d %d %d]\n",a[0],a[1],a[2],a[3]);
}
};
struct LCT {
struct{
int c[2],pa;
Mat val,prod;
} t[N];
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |