Editorial for SAC '22 Code Challenge 5 Junior P3 - Media List
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.
Submitting an official solution before solving the problem yourself is a bannable offence.
Author:
Subtask 1
Maintain a set of distinct names with a built-in data structure provided in your language (e.g., set<int>
for C++).
For each type 1
if the set contains 0
if it does not.
For each type
Note that a dynamic array is insufficient since
Time Complexity:
Subtask 2
Instead of using one set, define an array of
The same logic as subtask
Time Complexity:
Comments