Keyence Repetition
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Keyence Repetition
题目描述
是 keyence
重复 次形成的字符串。你可以删除任意个字符(可以是0个)形成新的字符串 。
可以证明有 个删除方法,你需要找到其中能使 的方法数,答案对 取模。
输入格式
第一行一个整数 ,第二行一个字符串 。
输出格式
一行,一个整数,表示满足题意的方法数对 取模的值。
样例 #1
样例输入 #1
2
key
样例输出 #1
6
样例 #2
样例输入 #2
2
ccc
样例输出 #2
0
样例 #3
样例输入 #3
100
keyneeneeeckyycccckkke
样例输出 #3
275429980
数据范围
- , 代表字符串 的长度
- 是只包含
c
,e
,k
,n
,y
的字符串
样例解释 1
keyencekeyence
, key
时,有 种方法,以下方法中括号内的数字表示保留的位置: $(1,2,3),(1,2,10),(1,4,10),(1,7,10),(1,9,10),(8,9,10)$ 。
20240611集训
- Status
- Done
- Rule
- IOI
- Problem
- 6
- Start at
- 2024-6-11 19:00
- End at
- 2024-6-11 21:00
- Duration
- 2 hour(s)
- Host
- Partic.
- 14