# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
915312 | Trisanu_Das | Holiday (IOI14_holiday) | C++17 | 24 ms | 6236 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 <bits/stdc++.h>
#include "holiday.h"
using namespace std;
long long findMaxAttraction(int n, int s, int d, int a[]) {
multiset<int> ss;
long long ans = 0, curr = 0;
for (int j=0; j < min(n,d - 1); j++) {
ss.insert(a[j]);
curr += a[j];
while (j + ss.size() > d) {
curr -= *begin(ss);
ss.erase(begin(ss));
}
ans = max(ans, curr);
}
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... |