22543_IncreasingSequences

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

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

Pro.ID

22543

Title

Increasing Sequences

Title链接

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

AC

0

Submit

0

Ratio

-

时间&空间限制

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

    Given a string of digits, insert commas to create a sequence of strictly increasing numbers so as to minimize the magnitude of the last number. For this problem, leading zeros are allowed in front of a number.

    输入

    Input will consist of multiple test cases. Each case will consist of one line, containing a string of digits of maximum length 80. A line consisting of a single 0 terminates input.

    输出

    Description
    Given a string of digits, insert commas to create a sequence of strictly increasing numbers so as to minimize the magnitude of the last number. For this problem, leading zeros are allowed in front of a number.
    Input
    Input will consist of multiple test cases. Each case will consist of one line, containing a string of digits of maximum length 80. A line consisting of a single 0 terminates input.
    Output
    For each instance, output the comma separated strictly increasing sequence, with no spaces between commas or numbers. If there are several such sequences, pick the one which has the largest first value; if there’s a tie, the largest second number, etc.
    Sample Input
    3456
    3546
    3526
    0001
    100000101
    0
    Sample Output
    3,4,5,6
    35,46
    3,5,26
    0001
    100,000101
    Source

    样例输入

    3456
    3546
    3526
    0001
    100000101
    0

    样例输出

    3,4,5,6
    35,46
    3,5,26
    0001
    100,000101

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部