#P3181. [HAOI2016] 找相同字符
[HAOI2016] 找相同字符
Description
Given two strings, count the number of ways to take one substring from each string such that the two substrings are equal. Two ways are different if and only if at least one of the substrings has a different position.
Input Format
Two lines: two strings , of lengths , respectively.
Output Format
Output a single integer representing the answer.
aabb
bbaa
10
Hint
, and the strings contain only lowercase letters.
Translated by ChatGPT 5
京公网安备 11011102002149号