PALIN
시간 제한: 2000ms메모리 제한: 128MB출처: CHC 2001 Regional Competition - SeniorsBOJ 2079
문제
A palindrome is a word that is read the same forward or backwards. If a word is not a palindrome, it can be cut into parts that are palindromes. Write a program that will calculate the smallest number of palindrome parts to which a given sequence of characters can be cut.
입력
The first and only line of input file contains a sequence of characters. The characters used as input will be from the set of small letters of English alphabet (a–z). The length of every input sequence will be at most 2000.
출력
The first and only line of output file should contain required number of palindromes.
예제
예제 1
입력
anaban
출력
2
예제 2
입력
abaccbcb
출력
3
예제 3
입력
anavolimilana
출력
5
코드를 제출하려면 로그인하세요.