QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 2048 MB Total points: 100

#5722. 彩虹字符串

Statistics

如果一个字符串中每个字母都各不相同,则称其为“彩虹字符串”(rainbow string)。空字符串也被视为彩虹字符串。

给定一个由小写字母组成的字符串,计算其为彩虹字符串的不同子序列的数量。如果两个子序列所选取的原字符串下标集合不同,则视为不同的子序列,即使它们构成的字符串内容相同。

在第一个样例中,共有 8 个子序列。其中不是彩虹字符串的子序列只有 aaaab。其余 6 个子序列均为彩虹字符串。

输入格式

输入包含一行,为一个仅由小写字母组成的字符串。字符串长度在 $1$ 到 $100\,000$ 之间(含边界)。

输出格式

输出一行,表示彩虹子序列的数量,结果对质数 $11\,092\,019$ 取模。

样例

输入格式 1

aab

输出格式 1

6

输入格式 2

icpcprogrammingcontest

输出格式 2

209952

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.