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

建议使用的浏览器:

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

2651:Spring festival couplets

题目描述
When the spring festival is coming , people always paste spring festival couplets onto the wall.Now dandelion's father has bought several spring festival couplets, he wants to know how many pairs of spring festival couplets can been consisted with these spring festival couplets.As we know ,spring festival couplets are carefully balanced.Such as AABBCCDD can only be matched with AABBCCDD or BBDDEEFF or AABBAABB ...
输入解释
A number n stands for the number of the spring festival couplets.(2≤n≤110000)
Then n lines ,each line contains a string made by capital letters. Such as AABBCCDD,AABBCCD.The length of the string will not exceed 8.
输出解释
For every case ,print the number of pairs can be made by these spring festival couplets.
输入样例
6
ABCCCDA
LLLMNNO
DEZZZBF
AAABCCD
KKKXPPQ
AAA
输出样例
4
来自杭电HDUOJ的附加信息
Author dandelion
Recommend yifenfei

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

题目来源 曾是惊鸿照影来

源链接: HDU-2651

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

共提交 0

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