22323_Suffidromes

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

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

Pro.ID

22323

Title

Suffidromes

Title链接

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

AC

1

Submit

1

Ratio

100.00%

时间&空间限制

  • Time Limit: 1200/400 MS (Java/Others)     Memory Limit: 131072/65536 K (Java/Others)
  • 描述

    Given two strings of lowercase letters, a and b, print the shortest string x of lowercase letters such that exactly one (but not both) of ax or bx is a palindrome; that is, equal to itself when reversed.

    输入

    Standard input contains several pairs of a and b. Each string is on a separate line and consists of between 0 and 1,000 lowercase letters.

    输出

    Description
    Given two strings of lowercase letters, a and b, print the shortest string x of lowercase letters such that exactly one (but not both) of ax or bx is a palindrome; that is, equal to itself when reversed.
    Input
    Standard input contains several pairs of a and b. Each string is on a separate line and consists of between 0 and 1,000 lowercase letters.
    Output
    For each pair, output a line containing x. If several x satisfy the criteria above, choose the first one in alphabetical order.
    Sample Input
    abab
    ababab
    abc
    def
    Sample Output
    baba
    ba
    Source

    样例输入

    abab
    ababab
    abc
    def

    样例输出

    baba
    ba

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部