# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
316395 | juggernaut | Holiday (IOI14_holiday) | C++14 | 5090 ms | 2624 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;
long long int findMaxAttraction(int n,int start,int d,int attraction[]){
long long rs=0;
for(int i=0;i<=start;i++){
priority_queue<int>q;
long long sum=0;
for(int j=i;j<n;j++){
q.push(-attraction[j]);
sum+=attraction[j];
int rem=d-min(start+j-(i<<1),(j<<1)-start-i);
while(q.size()>rem){
sum+=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... |