# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
316407 | juggernaut | Holiday (IOI14_holiday) | C++14 | 5053 ms | 2988 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"holiday.h"
#include<bits/stdc++.h>
#ifdef EVAL
#else
#include"grader.cpp"
#endif
using namespace std;
typedef long long ll;
ll findMaxAttraction(int n,int start,int d,int attraction[]){
ll rs=0;
for(int i=0;i<=start;i++){
priority_queue<ll>q;
ll sum=0;
for(int j=i;j<n;j++){
q.push(-attraction[j]);
sum+=attraction[j];
if(j<start)continue;
ll rem=d-min((start-i)+(j-i),(j-start)+(j-i));
while(!q.empty()&&q.size()>rem){
sum+=q.top();
q.pop();
}
rs=max(rs,sum);
}
}
return rs;
}
/*
5 2 7
10 2 20 30 1
*/
Compilation message (stderr)
# | 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... |