# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
526052 | two_sides | Cats or Dogs (JOI18_catdog) | C++17 | 0 ms | 0 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 <bits/stdc++.h>
using namespace std;
template <class X, class Y>
bool cmin(X &a, const Y &b) {
return a > b ? a = b, 1 : 0;
}
const int INF = 1e9;
struct Tp {
int val[2][2];
Tp operator + (const Tp &o) const {
Tp res;
for (int i = 0; i < 2; i++)
for (int j = 0; j < 2; j++) {
res.val[i][j] = min({INF,
val[i][0] + o.val[1][j] + 1,
val[i][1] + o.val[0][j] + 1,
val[i][0] + o.val[0][j],
val[i][1] + o.val[1][j]});
}
return res;
}
};
struct segTree {
private: