| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 2048 MB | 22 | 19 | 13 | 92.857% |
A palindrome is a string that reads the same forwards as backwards. For example, radar, noon, and a are palindromes, while bathtub, thought, and is are not.
Given a string $S$ consisting only of lowercase English letters. You can rearrange the letters in $S$ in any order you like. Your task is to split $S$ after rearrangement into as few palindromic substrings as possible.
The first and only line contains the string $S$ ($1 \le |S| \le 200000$) containing lowercase English letters.
On the first line, print the minimum number $k$ of palindrome substrings.
On the next $k$ lines, print the palindromes that the string $S$ (after rearrangement) can be split into. If there are multiple ways to split, you may output any of them.
larcevalecer
2 level racecar
abab
1 baab
indonesianationalcontest
8 i incni stats nnn ala odo t eoe
Explanation of Sample 1: We can rearrange the input string into levelracecar, then split the string into two palindromes: level and racecar. No rearrangement can produce a single palindrome, so the minimum number of palindromes is $2$.
ICPC > Regionals > Asia Pacific > Indonesia > Indonesia National Contest > INC 2025 K번