| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 | 1024 MB | 214 | 125 | 104 | 62.651% |
Each of Farmer John's $N$ barns (2ドル\le N\le 10^5$) has selected a team of $C$ cows (1ドル\le C\le 18$) to participate in field day. The breed of every cow is either a Guernsey or a Holstein.
The difference between two teams is defined to be the number of positions $i$ (1ドル \leq i \leq C$) at which the breeds of the cows in the $i$th positions differ. For every team $t$ from 1ドル \ldots N,ドル please compute the maximum difference between team $t$ and any other team.
The first line contains $C$ and $N$.
The next $N$ lines each contain a string of length $C$ of Gs and Hs. Each line corresponds to a team.
For each team, print the maximum difference.
5 3 GHGGH GHHHH HGHHG
5 3 5
The first and third teams differ by 5ドル$. The second and third teams differ by 3ドル$.