# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1153176 | brover29 | Triple Jump (JOI19_jumps) | C++20 | 4093 ms | 34888 KiB |
#include <bits/stdc++.h>
//qwerty47924692
using namespace std;
using ll = long long;
const ll N=5e5+29;
const string br="617283";
#define sz(a)(ll)a.size()
#define f first
#define s second
ll n,q,w[N],st[N][20],lg[N];
void build(){
lg[1]=0;
for(ll i=2;i<=n;i++)lg[i]=lg[i/2]+1;
for(ll j=1;j<20;j++){
ll k=(1ll<<j);
for(ll i=k-1;i<=n;i++){
st[i][j]=max(st[i][j-1],st[i-k/2][j-1]);
}
}
}
ll get(ll l,ll r){
if(l>r)return -1e18;
ll k=lg[r-l+1];
return max(st[r][k],st[l+(1ll<<k)-1][k]);
}ll check(ll a,ll b,ll r){
ll x=b-a;
return w[a]+w[b]+get(b+x,r);
}
int main(){
ios_base::sync_with_stdio(0);
# | 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... |