#P10581. [蓝桥杯 2024 国 A] 重复的串
[蓝桥杯 2024 国 A] 重复的串
Problem Description
Given a string consisting only of lowercase letters, ask how many strings of length consisting only of lowercase letters contain exactly twice. Output the answer modulo .
Input Format
Input one line containing a string and an integer , separated by a space.
Output Format
Output one line containing one integer representing the answer.
aba 6
53
aba 10
77907666
Hint
For of the test cases, and .
For another of the test cases, and .
For of the test cases, .
For all test cases, and .
Translated by ChatGPT 5