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"
long long int findMaxAttraction(int n, int start, int d, int attr[]) {
int c[101] = { 0 }, z = 0;
for (int i = 0; i < n; ++i) {
++c[attr[i]];
int lef = d - i, y = 0;
for (int j = 100; lef && j >= 0; --j) {
int u = c[j] < lef ? c[j] : lef;
lef -= u;
y += u * j;
}
if (y > z) z = y;
}
return z;
}
# | 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... |