QOJ.ac

QOJ

حد الوقت: 1.0 s حد الذاكرة: 64 MB مجموع النقاط: 100

#18079. 避免变位词

الإحصائيات

如果两个字符串可以通过字母重排互相转换,则称它们互为变位词(anagram)。例如,“listen”和“silent”互为变位词,而“master”和“nearest”则不是。

字符串 $s = s_1s_2 \dots s_n$ 的子序列是指字符串 $s_{a_1}s_{a_2} \dots s_{a_k}$,其中 $1 \le a_1 < a_2 < \dots < a_k \le n$。

给定字符串 $s$,确定其子序列构成的集合中,满足集合内任意两个字符串都不互为变位词的最大元素个数。

输入包含一行,为一个长度不超过 60 的小写拉丁字母组成的字符串 $s$。

输出一个数字,即答案。

样例

输入格式 1

jojo

输出格式 1

8

说明

在第一个样例中,符合条件的字符串列表可以是:“j”、“o”、“jj”、“jo”、“oo”、“jjo”、“joo”、“jojo”。

输入格式 2

uralchampionship

输出格式 2

20735

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.