QOJ.ac

QOJ

Límite de tiempo: 1.0 s Límite de memoria: 256 MB Puntuación total: 100

#10079. 彩票赢家

Estadísticas

WINNER 厌倦了在 NUP 的新会计工作中第 500 次实现 Z-函数,现在他正在寻找一种快速退休的方法。多亏了他广泛的人脉,他设法获得了 Paphos 所有 $n$ 个彩票的中奖号码。这些中奖号码以 12 进制书写,数字可能包含前导零。

然而,彩票发行方对于使用字母(来自大写英文字母表)表示数字 10 和 11 没有达成统一标准,因此每种彩票都使用自己选择的两个字母来表示这些值。尽管掌握了这些信息,WINNER 仍然不确定具体的获胜规则。他怀疑,为了领取奖金,他只需要在每张彩票的中奖号码中至少猜对一个数字即可。

WINNER 已经忘记了如何用纸笔书写,所以他需要帮助来计算他为了在所有彩票中“获胜”(按照他的理解)所需要学习的最少唯一字母数字的数量。

输入格式

输入的第一行包含一个整数 $n$ ($1 \le n \le 2.5 \cdot 10^5$),表示彩票的数量。

接下来的 $n$ 行,每行包含一个 12 进制的数字,表示每张彩票的中奖号码。对于每一行,都有一个大写字母表示数字 10,另一个不同的大写字母表示数字 11。该行仅包含数字和这两个字母。

保证所有数字的总长度不超过 $4 \cdot 10^6$。

输出格式

输出一个整数 $k$,表示 WINNER 为了相信自己能在每张彩票中获胜,所需要学习的最少唯一字母数字的数量。

样例

输入 1

4
EEXEE
X221
DEE
2555539BD

输出 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.