# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
596431 | CaroLinda | Peru (RMI20_peru) | C++14 | 538 ms | 34808 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 "peru.h"
#include <bits/stdc++.h>
#define ll long long
const int MAXN = 2500005;
const ll PRIME = 23;
const ll MOD = 1e9+7;
using namespace std;
ll dp[MAXN];
multiset<ll> ans;
deque<int> dq;
int solve(int n, int k, int* v){
for(int i = 0; i < n; i++){
while(!dq.empty() && dq.front() < i-k){
int id = dq.front();
dq.pop_front();
if(!dq.empty())
ans.erase(ans.find(dp[id]+v[dq.front()]));
}
while(!dq.empty() && v[dq.back()] <= v[i]){
ll tot = v[dq.back()];
dq.pop_back();
if(!dq.empty()){
ans.erase(ans.find(dp[dq.back()]+tot));
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |