# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
129495 | antimirage | Holiday (IOI14_holiday) | C++14 | 46 ms | 6328 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;
multiset <int> st;
long long int findMaxAttraction(int n, int start, int d, int a[]) {
long long ans = 0, sum = 0;
for (int i = 0; i < n; i++) {
if (i >= d) break;
st.insert(a[i]);
sum += a[i];
int k = d - i;
while (st.size() > k) {
sum -= *st.begin();
st.erase(st.begin());
}
ans = max(ans, sum);
}
return ans;
}
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... |