report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
  • Problem
  • Submit
  • Results
Concating substring - MarisaOJ: Marisa Online Judge

Concating substring

Time limit: 1000 ms
Memory limit: 256 MB
Given two strings $A$ and $B$, count the number of different ways to choose $k$ non-overlapping consecutive substrings from $A$ to concatenate and form the string $B$. The chosen substrings must maintain their relative order. ### Input - The first line contains an integer $n,m,k$. - The second line contains the string $A$ of length $n$. - The third line contains the string $B$ of length $m$. ### Output - A single integer representing the number of different ways to choose $k$ non-overlapping consecutive substrings from $A$ to form the string $B$, modulo $10^9+7$. ### Constraints - $1 \le |A| \le 1000$ - $1 \le |B| \le 200$ - $1 \le k \le |B|$ ### Example Input: ``` 6 3 2 aabaab aab ``` Output: ``` 7 ```
Introduction to Dynamic Programming (Part two)
Sake game
Coins
Coins 2
Game on array
Longest increasing subsequence 2
Convolution
Regular bracket sequence
Faulty addition
Weird bank
Delete operation
Palindromize
Color ribbon
Unique subsequences
Unique subsequences 2
Cow exhibition
Knapsack 3
Compressing array
Regular bracket sequence 2
Maximum path 3
Concating substring
Soil
Stacking boxes
String transformation
Palindromic quadruple
Finding teammates
Topic
Dynamic Programming
Rating 1600
Solution (1) Solution