# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1019723 | NValchanov | Holiday (IOI14_holiday) | C++17 | 24 ms | 6180 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;
typedef long long ll;
ll start0(int n, int d, int a[])
{
ll ans = 0;
set < int > s;
ll sum = 0;
for(int i = 0; i < n; i++)
{
s.insert(a[i]);
sum += a[i];
int ost = d - i - 1;
while(s.size() > ost)
{
auto it = s.begin();
sum -= *it;
s.erase(it);
}
ans = max(ans, sum);
}
return ans;
}
ll slow(int n, int start, int d, int a[])
{
return -1;
}
long long int findMaxAttraction(int n, int start, int d, int a[])
{
if(start == 0)
return start0(n, d, a);
else
slow(n, start, d, a);
}
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... |