#abc211c. C - chokudai

C - chokudai

Score : 300300 points

问题描述

给定一个字符串 SS

有多少种方法可以选择并以从左到右的顺序下划线其八个字符,使得这些字符拼出 c, h, o, k, u, d, a, i

由于计数可能会非常庞大,请将结果模 (109+7)(10^9 + 7) 后输出。

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

You are given a string SS.
How many ways are there to choose and underline eight of its characters so that those characters read c, h, o, k, u, d, a, i from left to right?
Since the count can be enormous, print it modulo (109+7)(10^9 + 7).

Constraints

  • 8S1058 \leq |S| \leq 10^5
  • SS consists of lowercase English letters.

Input

Input is given from Standard Input in the following format:

SS

Output

Print the number of ways modulo (109+7)(10^9 + 7).

Sample Input 1

chchokudai

Sample Output 1

3

We have three valid ways:

chchokudai
chchokudai
chchokudai

while the following is invalid:

chchokudai

Sample Input 2

atcoderrr

Sample Output 2

0

The answer may be 00.

Sample Input 3

chokudaichokudaichokudai

Sample Output 3

45

update @ 2024/3/10 09:25:47