# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
374453 | idk321 | Holiday (IOI14_holiday) | C++11 | 39 ms | 5652 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;
typedef long long ll;
long long int findMaxAttraction(int n, int start, int d, int v[]) {
if (d == 0) return 0;
if (start == 0)
{
ll res = v[0];
int a = 0;
int b = 0;
ll cur = v[0];
multiset<int> sett;
sett.insert(v[0]);
int cost = 1;
for (int i = 1; i < n && i <= d; i++)
{
cost += 2;
cur += v[i];
sett.insert(v[i]);
while (cost > d)
{
cur -= *sett.begin();
sett.erase(sett.begin());
cost--;
}
res = max(res, cur);
}
return res;
}
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... |