102112: [AtCoder]ABC211 C - chokudai
Memory Limit:256 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Score : $300$ points
Problem Statement
You are given a string $S$.
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 $(10^9 + 7)$.
Constraints
- $8 \leq |S| \leq 10^5$
- $S$ consists of lowercase English letters.
Input
Input is given from Standard Input in the following format:
$S$
Output
Print the number of ways modulo $(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 $0$.
Sample Input 3
chokudaichokudaichokudai
Sample Output 3
45
Input
题意翻译
给定一个字符串,求有多少个非连续子串`chokudai`。 **注意:此处非连续子串的定义是:有字符串 $a,b$,如果从 $a$ 的任意位置删除若干个字符后可以得到 $b$,则称 $b$ 是 $a$ 的非连续子串。** 答案对 $10^9+7$ 取模。Output
得分:300分
问题描述
你被给定一个字符串$S$。
有多少种方法可以选择并强调它的8个字符,使得这些字符从左到右读作c
,h
,o
,k
,u
,d
,a
,i
?
由于计数可能非常大,因此请将其对$(10^9 + 7)$取模。
约束条件
- $8 \leq |S| \leq 10^5$
- $S$由小写英文字母组成。
输入
输入从标准输入按以下格式给出:
$S$
输出
对$(10^9 + 7)$取模后打印计数。
样例输入1
chchokudai
样例输出1
3
我们有三种有效方法:
chchokudai
chchokudai
chchokudai
而以下无效:
chchokudai
样例输入2
atcoderrr
样例输出2
0
答案可能是$0$。
样例输入3
chokudaichokudaichokudai
样例输出3
45