# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
277691 | tmwilliamlin168 | Constellation 3 (JOI20_constellation3) | C++14 | 401 ms | 45816 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;
#define ll long long
#define ar array
const int mxN=2e5;
int n, m, a[mxN];
ar<int, 3> b[mxN];
ll s, dp2[mxN];
struct ds1 {
ar<int, 2> st[2*mxN];
void init() {
for(int i=0; i<n; ++i)
st[i+n]={a[i], i};
for(int i=n-1; i; --i)
st[i]=max(st[2*i], st[2*i+1]);
}
ar<int, 2> qry(int l, int r) {
ar<int, 2> b{};
for(l+=n, r+=n+1; l<r; ++l/=2, r/=2) {
if(l&1)
b=max(st[l], b);
if(r&1)
b=max(st[r-1], b);
}
return b;
}
} ds1;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |