# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
942070 | Pannda | Ants and Sugar (JOI22_sugar) | C++17 | 4070 ms | 144880 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;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
const int CL = 0, CR = 1e9 + 1;
const long long INF = 1e18;
struct Node {
int ln = 0, rn = 0;
long long ant = 0, sugar = 0, sugar2 = 0;
long long lazy_sugar = 0, lazy_sugar2 = 0;
vector<vector<long long>> mn = { { 0, 0 }, { 0, 0 } };
Node operator+(Node b) {
Node a = *this;
Node res;
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 2; j++) {
res.mn[i][j] = INF;
res.mn[i][j] = min(res.mn[i][j], a.mn[i][0] + b.mn[0][j]);
res.mn[i][j] = min(res.mn[i][j], a.mn[i][0] + b.mn[1][j]);
res.mn[i][j] = min(res.mn[i][j], a.mn[i][1] + b.mn[0][j]);
res.mn[i][j] = min(res.mn[i][j], a.mn[i][1] + b.mn[1][j] - a.sugar2);
}
}
res.sugar2 = b.sugar2;
return res;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |