# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
277664 | tmwilliamlin168 | 별자리 3 (JOI20_constellation3) | C++14 | 415 ms | 53460 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ar array
const int mxN=3e5;
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... |