Logo
(追記) (追記ここまで)

28032번 - Field Day 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 1024 MB21412510462.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.

제한

예제 입력 1

5 3
GHGGH
GHHHH
HGHHG

예제 출력 1

5
3
5

힌트

The first and third teams differ by 5ドル$. The second and third teams differ by 3ドル$.

출처

Olympiad > USA Computing Olympiad > 2022-2023 Season > USACO 2023 US Open Contest > Silver 2번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /