# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
866926 | Onur_Ilgaz | 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"holiday.h"
#include <bits/stdc++.h>
#define int long long
#define inf ((int)1e18)
using namespace std;
int findMaxAttraction(int32_t n, int32_t start, int32_t d, int32_t arr[]) {
multiset <int> st;
int sum = 0, mx = 0;
for(int i = 0; i < n; i++, d--) {
st.insert(arr[i]);
sum += arr[i];
while(st.size() > d) {
sum -= *st.begin();
st.erase(st.begin());
}
mx = max(mx, sum);
}
return mx;
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... |