QOJ.ac

QOJ

시간 제한: 1.0 s 메모리 제한: 512 MB 총점: 100 해킹 가능 ✓

#16840. 谜题

통계

给你一个谜题。给定一个由 $n$ 行 $m$ 列组成的表格,表格中填满了 $0$ 和 $1$。只允许进行一种操作:在任意一列中,你可以自由地重新排列其中的元素,即以任何方式改变该列中各行元素的顺序。每列中 $0$ 和 $1$ 的数量保持不变。

你可以根据需要进行任意多次此类操作。谜题的目标是获得尽可能多的完全相同的行。

请确定使用上述操作可以使多少行变得完全相同(求最大行数)。

输入格式

第一行包含两个整数 $n$ 和 $m$($1 \le n, m \le 10^5$;$nm \le 2 \cdot 10^5$),分别表示行数和列数。

接下来的 $n$ 行,每行包含 $m$ 个字符 01,表示初始表格中的元素。

输出格式

输出一个整数,表示可以获得的最大相同行数。

样例

输入样例 1

3 4
0101
0010
0100

输出样例 1

2

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.