10114_CalfFlac

2022-5-16 18:16| 发布者: Hocassian| 查看: 77| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-3-89504565725100-Problem List-采集的数据-后羿采集器.html

Pro.ID

10114

Title

Calf Flac

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=10114

AC

76

Submit

413

Ratio

18.40%

时间&空间限制

  • Time Limit: 200/100 MS (Java/Others)     Memory Limit: 32768/32768 K (Java/Others)
  • 描述

    It is said that if you give an infinite number of cows an infinite number of heavy-duty laptops (with very large keys), that they will ultimately produce all the world's great palindromes. Your job will be to detect these bovine beauties.

    Ignore punctuation, whitespace, numbers, and case when testing for palindromes, but keep these extra characters around so that you can print them out as the answer; just consider the letters 'A-Z' and 'a-z'.

    Find any largest palindrome in a string no more than 20,000 characters long. The largest palindrome is guaranteed to be at most 2,000 characters long before whitespace and punctuation are removed.

    输入

    A file with no more than 20,000 characters. The file has one or more lines. No line is longer than 80 characters (not counting the newline at the end).

    输出

    Description

    It is said that if you give an infinite number of cows an infinite number of heavy-duty laptops (with very large keys), that they will ultimately produce all the world's great palindromes. Your job will be to detect these bovine beauties.

    Ignore punctuation, whitespace, numbers, and case when testing for palindromes, but keep these extra characters around so that you can print them out as the answer; just consider the letters 'A-Z' and 'a-z'.

    Find any largest palindrome in a string no more than 20,000 characters long. The largest palindrome is guaranteed to be at most 2,000 characters long before whitespace and punctuation are removed.

    Input

    A file with no more than 20,000 characters. The file has one or more lines. No line is longer than 80 characters (not counting the newline at the end).

    Output

    The first line of the output should be the length of the longest palindrome found. The next line or lines should be the actual text of the palindrome (without any surrounding white space or punctuation but with all other characters) printed on a line (or more than one line if newlines are included in the palindromic text). If there are multiple palindromes of longest length, output the one that appears first.

    Sample Input
    Confucius say: Madam, I'm Adam.
    Sample Output
    11
    Madam, I'm Adam
    Source

    样例输入

    Confucius say: Madam, I'm Adam.

    样例输出

    11
    Madam, I'm Adam

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部