Submission #596431

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5964312022-07-14 18:18:08CaroLindaPeru (RMI20_peru)C++14
100 / 100
538 ms34808 KiB
#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));
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...