# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
114419 | E869120 | Holiday (IOI14_holiday) | C++14 | 21 ms | 2040 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;
long long e[109];
long long int findMaxAttraction(int n, int start, int d, int attraction[]) {
long long maxn = 0;
for (int i = 0; i < n; i++) {
e[attraction[i]]++;
long long s = 0, rem = d - i;
for (int j = 100; j >= 0; j--) {
if (rem >= e[j]) { rem -= e[j]; s += 1LL * e[j] * j; }
else { s += 1LL * rem * j; rem = 0; }
}
maxn = max(maxn, s);
}
return maxn;
}
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... |