# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
696132 | sharaelong | Rainforest Jumps (APIO21_jumps) | C++17 | 2138 ms | 53560 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 "jumps.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
struct SegmentTree {
int n, h;
vector<pii> arr;
SegmentTree(int _n) : n(_n) {
h = Log2(n);
n = 1 << h;
arr.resize(2*n);
for (int i=n; i<2*n; ++i) arr[i] = { 0, i-n };
for (int i=n-1; i>=0; --i) arr[i] = { 0, arr[2*i].second };
}
void update(int pos, int c) {
pos += n;
arr[pos] = { c, pos-n };
for (pos /= 2; pos > 0; pos /= 2) {
arr[pos] = (arr[2*pos].first > arr[2*pos+1].first ? arr[2*pos] : arr[2*pos+1]);
}
}
pii query(int l, int r) {
l += n, r += n;
pii ret = {0,-1};
for (; l <= r; l/=2, r/=2) {
if (l & 1) ret = (ret.first > arr[l].first ? ret : arr[l]), l++;
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |