10073_Commonpermutation

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

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

Pro.ID

10073

Title

Common permutation

Title链接

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

AC

0

Submit

4

Ratio

0.00%

时间&空间限制

  • Time Limit: 1000/500 MS (Java/Others)     Memory Limit: 32768/32768 K (Java/Others)
  • 描述

    Given two strings of lowercase letters, a and b, print the longest string x of lowercase letters such that there is a permutation of x that is a subsequence of a and there is a permutation of x that is a subsequence of b.

    输入

    Input consists of pairs of lines. The first line of a pair contains a and the second contains b. Each string is on a separate line and consists of at most 1,000 lowercase letters.

    输出

    Description

    Given two strings of lowercase letters, a and b, print the longest string x of lowercase letters such that there is a permutation of x that is a subsequence of a and there is a permutation of x that is a subsequence of b.

    Input

    Input consists of pairs of lines. The first line of a pair contains a and the second contains b. Each string is on a separate line and consists of at most 1,000 lowercase letters.

    Output

    For each subsequent pair of input lines, output a line containing x. If several x satisfy the criteria above, choose the first one in alphabetical order.

    Sample Input
    pretty
    women
    walking
    down
    the
    street
    Sample Output
    e
    nw
    et
    Source

    样例输入

    pretty
    women
    walking
    down
    the
    street

    样例输出

    e
    nw
    et

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部