当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2657:Word Game

题目描述
If you have a circle consists of L characters. We can define one of them as 0th character, and then 1st, 2nd …… (L -1)th along the clockwise. A string beginning with the ith character can be get from this circle, let's call it p[i] (All of these string has a length of L). From 0 to L -1, if there exists exactly K positions i make p[i] as same as p[0], then we call it a magic word.
Give you n strings and a K. Please use all of these strings to creat a new string p. Tell me how many ways exists to construct a string p and make it a magic word.
输入解释
The input contains several cases. Each case starts with two integer n and K. Then follows n lines, each line contain a string. 0 < n <= 8, 0 < K <= 200, each string contain between 1 and 20 characters. Input ends with a case n = 0 and K = 0.
输出解释
Each case print a line with an integer.
输入样例
3 3
AAB
AAB
AAB
0 0
输出样例
6

提示
hints:
Use these strings, you can construct six "AABAABAAB".
来自杭电HDUOJ的附加信息
Author CTW
Recommend yifenfei

该题目是Virtual Judge题目,来自 杭电HDUOJ

题目来源 决战龙虎门

源链接: HDU-2657

最后修改于 2020-10-25T22:55:36+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
8000/4000MS(Java/Others) 32768/32768K(Java/Others)