# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1064176 | VMaksimoski008 | Holiday (IOI14_holiday) | C++17 | 11 ms | 2160 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>
using namespace std;
using ll = long long;
ll findMaxAttraction(int n, int start, int d, int attraction[]) {
if(start == 0) {
ll ans = 0, sum = 0;
priority_queue<ll, vector<ll>, greater<ll> > pq;
for(int i=0; i<min(d, n); i++) {
pq.push(attraction[i]);
sum += attraction[i];
while(pq.size() > d - i) {
sum -= pq.top();
pq.pop();
}
ans = max(ans, sum);
}
return ans;
}
return 0;
}
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... |