#P17330. [ICPC 2018 Nanjing R] Mediocre String Problem
[ICPC 2018 Nanjing R] Mediocre String Problem
题目描述
Given two strings and , count the number of tuples such that
- .
- .
- The -th character of to the -th character of , concatenated with the first character of to the -th character of , is a palindrome.
A palindrome is a string which reads the same backward as forward, such as "" or "".
输入格式
The first line is the string ().
The second line is the string ().
Both and contain only lower case Latin letters.
输出格式
The number of such tuples.
ababa
aba
5
aabbaa
aabb
7