# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
316399 | juggernaut | Holiday (IOI14_holiday) | C++14 | 5067 ms | 3008 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(ll i=0;i<=start;i++){
priority_queue<ll>q;
ll sum=0;
for(ll j=i;j<n;j++){
q.push((ll)-attraction[j]);
sum+=(ll)attraction[j];
if(j<start)continue;
ll rem=(ll)d-min(start+j-(i<<1ll),(j<<1ll)-start-i);
while(!q.empty()&&q.size()>rem){
sum+=(ll)q.top();
q.pop();
}
rs=max(rs,sum);
}
}
return rs;
}
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... |