Editorial for CCC '23 J3 - Special Event

Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.

Each of the subtasks for this problem requires us to keep a count for each day of the number of people able to attend the event on that day. These can be kept in five separate variables because there are only five days. However, it is cleaner and probably less error-prone to store these counts in a list or array.

For the first subtask, we can simply search for a day with a count of N. We are told that there will only be one such day.

For the second subtask, we have to calculate the maximum of these five counts and then find the day corresponding to this maximum value. We are told there will only be one such day.

For the third and final subtask, we need to handle "ties". That is, there could be more than one day with the same maximum count value. It is a bit tricky to output the right answer in this case. It is important to avoid printing a comma after the final day number.


There are no comments at the moment.