# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1168947 | mousebeaver | Triple Jump (JOI19_jumps) | C++20 | 22 ms | 5716 KiB |
#define ll long long
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
ll n;
cin>>n;
vector<ll> a(n);
for(ll& i : a)
cin>>i;
vector<ll> pre = {0}; //Greater than everything after that (index)
vector<ll> dp(n, 0); //Greatest usable pair of a, b if dp[i] is c
for(ll j = 1; j < n; j++)
{
ll p = pre.size();
for(ll i = 0; i < p; i++)
{
ll ind = pre[p-i-1];
ll minc = 2*(j+1) - (ind+1);
if(minc > n)
continue;
dp[minc-1] = max(dp[minc-1], a[j]+a[ind]);
if(a[ind] >= a[j])
break;
# | 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... |