Preparing NOJ

# I Love Palindrome String

2000ms 131072K

## Description:

You are given a string $S = s_1s_2..s_{|S|}$$containing only lowercase English letters. For each integer $i \in [1, |S|]$$ , please output how many substrings $s_ls_{l + 1}...s_r$$satisfy the following conditions: $\quad$$ $\bullet$$$r - l + 1$$ equals to $i$$. $\quad$$ $\bullet$$The substring $s_ls_{l + 1}...s_r$$ is a palindrome string.

$\quad$$$\bullet$$ $s_ls_{l + 1}...s_{ \lfloor (l + r) / 2 \rfloor }$$is a palindrome string too. $|S|$$ denotes the length of string $S$$. A palindrome string is a sequence of characters which reads the same backward as forward, such as $madam$$ or $racecar$$or $abba$$.

## Input:

There are multiple test cases.

## Sample Input:

abababa

## Sample Output:

7 0 0 0 3 0 0

Info

Provider HDU

Origin HDU849-1009

Code HDU6599

Tags

Submitted 14

Passed 2

AC Rate 14.29%

Date 07/24/2019 12:34:17

Related

Nothing Yet