Submission #1061893

#TimeUsernameProblemLanguageResultExecution timeMemory
1061893sleepntsheepHoliday (IOI14_holiday)C++17
23 / 100
17 ms1152 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 = c[j] < lef ? c[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...