# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
846742 | lohacho | Railway Trip (JOI17_railway_trip) | C++14 | 331 ms | 103512 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>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
using namespace std;
const int NS = (int)1e5 + 4, SZ = (int)3e5 + 4;
int a[NS + 4];
int seg[NS * 4 + 4];
int spa[SZ][20][2][2], dep[SZ], lcnt[SZ], pr[SZ][20];
int st[NS];
vector<int> pos[NS];
void build(int x, int s, int e){
if(s == e){
seg[x] = a[s];
return;
}
int m = s + e >> 1;
build(x * 2, s, m);
build(x * 2 + 1, m + 1, e);
seg[x] = max(seg[x * 2], seg[x * 2 + 1]);
}
int get(int x, int s, int e, int fs, int fe){
if(fe < s || fs > e || fs > fe) return -1;
if(fs <= s && fe >= e){
return seg[x];
}
int m = s + e >> 1;
return max(get(x * 2, s, m, fs, fe), get(x * 2 + 1, m + 1, e, fs, fe));
}
# | 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... |