This content is archived!
For the 2018-2019 school year, we have switched to using the WLMOJ judge for all MCPT related content. This is an archive of our old website and will not be updated.We’ll use the assumption that we can minimize the number of candy given by making the class average exactly 50%. First, we find the average of all the scores. Then we subtract 50% from the marks to find how much we have to adjust all the marks by.
After finding our adjustment value, we go through all the marks to figure out who passes. If the mark + adjustment is at least a 50%, then we add one more to our candy counter. Output the final value of the counter.
Time complexity
\mathcal{O}(N), where N is the number of students.