# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
134502 | RezwanArefin01 | Triple Jump (JOI19_jumps) | C++17 | 1417 ms | 111600 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;
typedef long long ll;
typedef pair<int, int> ii;
const int N = 5e5 + 10;
const ll inf = 1e18;
int n, q, a[N], ans[N];
vector<ii> Q[N];
vector<int> B[N];
struct Node {
ll a, f, af;
Node(ll a = -inf, ll f = -inf, ll af = -inf):
a(a), f(f), af(af) {}
} t[N << 2];
Node merge(Node l, Node r) {
return Node(max(l.a, r.a), max(l.f, r.f), max({l.af, r.af, l.f + r.a}));
}
void update(int node, int l, int r, int i, int x, int f) {
if(l == r) {
if(f) t[node].f = max(t[node].f, (ll)x);
else t[node].a = max(t[node].a, (ll)x);
t[node].af = max(-inf, t[node].f + t[node].a);
} else {
int m = l + r >> 1;
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... |