• <input id="auww4"></input>
  • <input id="auww4"><acronym id="auww4"></acronym></input>
  • <input id="auww4"><u id="auww4"></u></input>
    <object id="auww4"><acronym id="auww4"></acronym></object>
    <menu id="auww4"></menu><input id="auww4"><u id="auww4"></u></input>
    <input id="auww4"><u id="auww4"></u></input>
  • F.A.Q
    Hand In Hand
    Online Acmers
    Forum | Discuss
    Statistical Charts
    Problem Archive
    Realtime Judge Status
    Authors Ranklist
     
         C/C++/Java Exams     
    ACM Steps
    Go to Job
    Contest LiveCast
    ICPC@China
    Best Coder beta
    VIP | STD Contests
    Virtual Contests
        DIY | Web-DIY beta
    Recent Contests
    Author ID 
    Password 
     Register new ID

    Sequence one

    Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
    Total Submission(s): 1164    Accepted Submission(s): 468


    Problem Description
    Search is important in the acm algorithm. When you want to solve a problem by using the search method, try to cut is very important.
    Now give you a number sequence, include n (<=1000) integers, each integer not bigger than 2^31, you want to find the first P subsequences that is not decrease (if total subsequence W is smaller than P, than just give the first W subsequences). The order of subsequences is that: first order the length of the subsequence. Second order the sequence of each integers position in the initial sequence. For example initial sequence 1 3 2 the total legal subsequences is 5. According to order is {1}; {3}; {2}; {1,3}; {1,2}. {1,3} is first than {1,2} because the sequence of each integers position in the initial sequence are {1,2} and {1,3}. {1,2} is smaller than {1,3}. If you also can not understand , please see the sample carefully.
     

    Input
    The input contains multiple test cases.
    Each test case include, first two integers n, P. (1<n<=1000, 1<p<=10000).
     

    Output
    For each test case output the sequences according to the problem description. And at the end of each case follow a empty line.
     

    Sample Input
    3 5 1 3 2 3 6 1 3 2 4 100 1 2 3 2
     

    Sample Output
    1 3 2 1 3 1 2 1 3 2 1 3 1 2 1 2 3 1 2 1 3 2 3 2 2 1 2 3 1 2 2
    Hint
    Hint : You must make sure each subsequence in the subsequences is unique.
     

    Author
    yifenfei
     

    Source
     

    Recommend
    yifenfei
     

    Statistic | Submit | Discuss | Note
    Hangzhou Dianzi University Online Judge 3.0
    Copyright © 2005-2021 HDU ACM Team. All Rights Reserved.
    Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
    Total 0.015600(s) query 2, Server time : 2021-01-18 18:37:44, Gzip enabled