Distinct Subsequences

查看题解 查看答案
题目描述
Time Limit: 1000 ms
Memory Limit: 256 mb

请先登录再刷题,不会做的题目右上可以查看题解和答案~

输入输出格式
输入描述:
The first line is an interger Q( Q = 50 ), indicating the number of test cases.
Then in each case:
The first line is the string S, and the second line is the string T. ( 0 < |S|, |T| ≤ 1e4 )
The data guarantee every character of T is randomly generated.
输出描述:
Q lines and each line contains an interger P, representing the number of different subsequences of S which is equal to T.
Since P maybe very large, you should output it after module 1000000007(1e9+7).
输入输出样例
输入样例#:
2
aaabbb
ab
njnunju
nju
输出样例#:
复制
9
5
题目来源
南京大学2019年机试题
重置

提交代码后在此处可查看状态