Submission #1061891

#TimeUsernameProblemLanguageResultExecution timeMemory
1061891sleepntsheepHoliday (IOI14_holiday)C++17
0 / 100
19 ms1628 KiB
#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 = attr[j] < lef ? attr[j] : lef; lef -= u; y += u * j; } if (y > z) z = y; } return z; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...