Logo
(追記) (追記ここまで)

9351번 - Casino 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB6081547121.646%

문제

Dalia is the assistant director of the fundraising team in the ACPC. She is facing a difficult time this year, there’s a huge lack of sponsors! And now we are facing the danger of not being able to provide the teams with balloons, T-shirts or even name-tags.

Dalia knows it is too late to get a sponsor, actually too late to do anything. But she doesn’t simply give up; she decided that her only hope is to gamble. She will go to a casino where they just invented a new game; she thinks she might have a more promising chance if she plays that game.

The game is very simple, the dealer puts a long string of cards on the table in front of Dalia and she is required to point out palindromes longer than one character (words that are read backward the same as forward) of maximum length (a maximum length palindrome is a palindrome that no other palindrome exists in the string with greater length). So if the maximum length of palindrome in a string is X>1, print all palindromes of length X in the string.

입력

Input will start with T number of test cases. Each test case will consist of 1 line that contains a non- empty string S of lower case English letters no longer than 1000 characters.

출력

For each test case, print a line containing the case number as shown in the sample then print the palindromes each on a line by itself, in the order of their occurrence in S from right to left.

제한

예제 입력 1

2
abcba
abba

예제 출력 1

Case #1:
abcba
Case #2:
abba

힌트

출처

ICPC > Regionals > Africa and Arab > Arab Collegiate Programming Contest > ACM Jordanian Collegiate Programming Contest > JCPC 2012 C번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /