Editorial for COCI '06 Regional #1 Bard


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.

For each villager, we keep track of which songs he or she knows. We will also need to know the number of songs sung by the Bard.

When the bard is present, the song counter is incremented by one and the arrays of all villagers present are updated accordingly. If the bard is not present, then all present villagers learn the union of the songs they know between them.


Comments

There are no comments at the moment.