# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
655548 | piOOE | Triple Jump (JOI19_jumps) | C++17 | 716 ms | 40604 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;
struct Info {
int add = 0, a = 0, ans = 0;
};
Info operator+(Info a, Info b) {
return {max(a.add, b.add), max(a.a, b.a), max({a.ans, b.ans, a.add + b.a})};
}
int sz = 1;
vector<Info> t;
void init(int n, vector<int> a) {
sz = n;
t.assign(sz << 1, {});
for (int i = 0; i < n; ++i) {
t[i + sz].a = t[i + sz].ans = a[i];
}
for (int i = sz - 1; i > 0; --i) {
t[i] = t[i << 1] + t[i << 1 | 1];
}
}
Info rangeQuery(int l, int r) {
Info L{}, R{};
for (l += sz, r += sz; l < r; l >>= 1, r >>= 1) {
if (l & 1) {
# | 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... |