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

建议使用的浏览器:

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

6733:Sakurada Reset

题目描述
A huge revolution is coming up in Sakurada. In order to avoid the revolution, Asai Kei is going to take some actions. The director of the revolution will also take some actions to defend Asai Kei. In this problem, each action can be described as a positive integer.
Specifically, Asai Kei will choose a non-empty subsequence as the actual actions to take from a given sequence a. Meanwhile, the director will similarly choose a non-empty subsequence as the defending actions from a given sequence b. And the influence value of a sequence of actions p1, p2, · · · , pk of length k is defined as follows:
$\sum^{k}_{i=1}$$p_i$ * ${1000}^{k-i}$

Now given action sequences a and b, Asai Kei will choose a non-empty subsequence A from a and the director will choose a non-empty subsequence B from b. Asai Kei can beat the director if and only if the influence value of A is strictly greater than B.
You want to know the number of different schemes for them to choose subsequences A and B so that Asai Kei can beat the director. Two schemes (A1, B1),(A2, B2) are considered to be different if A1 = A2 or B1 = B2, and two sequences p, q are considered to be different if their influence values are different. Print the answer modulo 998244353 in a single line.
输入解释
The first line contains two positive integers n, m (1 ≤ n, m ≤ 5 000), denoting the length of a and the length of b.
The next line contains n positive integers ai (1 ≤ ai ≤ 100), denoting the sequence a.
The next line contains m positive integers ai (1 ≤ bi ≤ 100), denoting the sequence b.
输出解释
Output a single line containing a non-negative integer, denoting the answer modulo 998244353.
输入样例
3 5
2 1 2
1 2 2 1 2
输出样例
22
提示
Asai Kei can choose 6 subsequences: (1), (2), (1,2), (2,1), (2,2), (2,1,2), and their influence values
are 1, 2, 1002, 2001, 2002, 2001002 respectively. The director can choose 11 subsequences: (1), (2),
(1,1), (1,2), (2,1), (2,2), (1,1,2), (1,2,1), (1,2,2), (2,1,2), (2,2,2), and their influence values are 1, 2,
1001, 1002, 2001, 2002, 1001002, 1002001, 1002002, 2001002, 2002002 respectively.
There are 0 + 1 + 3 + 4 + 5 + 9 = 22 schemes in total that Asai Kei can beat the director.
来自杭电HDUOJ的附加信息
Recommend chendu

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

题目来源 642ccpcQHD

源链接: HDU-6733

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

共提交 0

通过率 --%
时间上限 内存上限
15000/12000MS(Java/Others) 524288/524288K(Java/Others)