#P5479. [BJOI2015] 隐身术
[BJOI2015] 隐身术
Description
Given two strings and . How many non-empty substrings of have an edit distance to that is at most ?
A “substring” means a consecutive segment of . Substrings with the same content but different positions are counted multiple times. The “edit distance” between two strings is the minimum number of operations needed to change one string into the other. Each operation can insert, delete, or replace one character.
Input Format
The first line contains a non-negative integer . The next two lines each contain a string of uppercase letters, representing and respectively.
Output Format
Output one line containing an integer, which is the required answer.
1
AAA
AABBAAB
5
Hint
For of the data, , both strings are non-empty, and the sum of their lengths is less than .
Translated by ChatGPT 5
京公网安备 11011102002149号