#634
Unrated
Field Day
시간 제한
2s
메모리 제한
1024MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

Note: The time limit for this problem in Python is 15s. Other languages have the default time limit of 2s.

Each of Farmer John's NN barns (2N1052\le N\le 10^5) has selected a team of CC cows (1C181\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 ii (1iC1 \leq i \leq C) at which the breeds of the cows in the iith positions differ. For every team tt from 1N1 \ldots N, please compute the maximum difference between team tt and any other team.

입력

The first line contains CC and NN.

The next NN lines each contain a string of length CC 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

점수

Inputs 2-5: C=10C = 10Inputs 6-9: All answers are at least C3C-3. Inputs 10-20: No additional constraints.

코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Unrated0명 투표
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.