Editorial for COCI '23 Contest 4 #1 Bingo
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.
Let's first solve the first subtask for , i.e. there is only one player. For each drawn number, we will
check if it is on the player's board. If it is on the board, we will replace it with
, since
cannot be drawn
due to the constraints of the task. After marking all drawn numbers, we will check if the player has a
Bingo!. We just need to check if all numbers in the row, column or diagonal are
.
To solve the whole task, we can easily extend the solution for the first subtask to multiple players.
Comments