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

建议使用的浏览器:

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

3726:Windy's ABC

题目描述

Windy is a stupid boy who can only write ABC. Now he has written a string S which contains only ABC and wonder how many string is a good copy of S. A copy is a permutation of S and a copy is good if and only if the distance between the positions of every letter in S and the copy is in a certain range. The range of distance of letter A B C is RA, RB and RC.

输入解释

The first line of input is the number of test case.
The first line of each test case contains three integers, RA, RB and RC.
The second line contains string S.
There is a blank line before each test case.

0 ≤ RA, RB and RC ≤ 10^9
0 < The length of S ≤ 500

输出解释

For each test case output the answer on a single line. Since the answer may be very large, just output the answer modulo 20090305.

输入样例
4

1 1 0
AB

1 1 0
ABBA

2 3 4
ABBBABACCBCAABCBBCCC

3 1 5
ABCCCBCABACAAAB

输出样例
2
4
645716
6660

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-3726

最后修改于 2020-10-29T07:09:12+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
5000 65536