시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
12 초 | 512 MB | 74 | 26 | 16 | 29.630% |
A mosaic is a picture made from square tiles arranged in a grid, at least for today’s purposes.
We would like to make a mosaic with exactly the same number of tiles of each colour. We will do this by taking an existing design and removing some of the rows from it.
Figure M.1: Illustration of a solution to Sample Input 1. The three rows annotated with white can be kept, giving 6 of each colour of tile.
What is the greatest number of rows we can keep?
Output the greatest number of rows that can be kept while keeping equal representation for each colour in the input, or 0 if no rows can be kept.
4 10 5 1 2 1 2 3 1 2 3 4 3 5 2 5 3 5 5 5 5 1 4 2 3 2 1 4 3 3 2 1 4 1 2 3 4 4 4 4 1 2 3
3
ICPC > Regionals > Europe > Northwestern European Regional Contest > The UK & Ireland Programming Contest > UKIEPC 2019 M번