logo AlgoBeat OnlineJudge
登录 注册

#208578. [USACO23OPEN] Field Day S

内存限制:256 MiB 时间限制:2000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

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 barns has selected a team of cows 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 () at which the breeds of the cows in the th positions differ. For every team from , please compute the maximum difference between team and any other team.

输入格式

The first line contains and .

The next lines each contain a string of length 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 . The second and third teams differ by .

, .

  • Inputs 2-5: .
  • Inputs 6-9: All answers are at least .
  • Inputs 10-20: No additional constraints.