# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
569158 | sidon | Railway Trip 2 (JOI22_ho_t4) | C++17 | 668 ms | 41872 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;
const int Z = 1e5, B = 17;
int N, K, M;
struct ST {
int a[2*Z] {}, minQry = 0;
void update(int i, int v) {
i += N;
for(a[i] = max(a[i], minQry ? Z-v : v); i /= 2; )
a[i] = max(a[2*i], a[2*i+1]);
}
int query(int l, int r) {
int x {};
for(l += N, r += N + 1; l < r; l /= 2, r /= 2) {
if(l & 1) x = max(x, a[l++]);
if(r & 1) x = max(x, a[--r]);
}
return minQry ? Z-x : x;
}
int operator[](int i) {
return minQry ? Z - a[i + N] : a[i + N];
}
} s[2][B];
int main() {
ios::sync_with_stdio(0), cin.tie(0);
cin >> N >> K >> M;
# | 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... |