# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
883489 | vjudge1 | Ants and Sugar (JOI22_sugar) | C++17 | 903 ms | 118332 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.
// https://oj.uz/problem/view/JOI22_sugar
#include <bits/stdc++.h>
using namespace std;
/*
Hall's theorem
Answer = A - max(|S| - |NG(S)|)
*/
const int64_t inf = 1e18;
class segtree_t {
public:
segtree_t *left, *right;
int l, r, m;
int64_t x[2][2], lazyx, lazy_mid, mid;
segtree_t(int l, int r) : l(l), r(r), m(l + r >> 1), lazy_mid(0), lazyx(0), mid(0) {
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 2; j++) {
x[i][j] = 0;
}
}
if (l == r) return;
left = new segtree_t(l, m);
right = new segtree_t(m + 1, r);
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |