Distinct ValuesTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1833 Accepted Submission(s): 577 Problem Description Chiaki has an array of n positive integers. You are told some facts about the array: for every two elements ai and aj in the subarray al..r (l≤i<j≤r ), ai≠aj holds. Input There are multiple test cases. The first line of input contains an integer T , indicating the number of test cases. For each test case: Output For each test case, output n integers denoting the lexicographically minimal array. Integers should be separated by a single space, and no extra spaces are allowed at the end of lines. Sample Input
3 2 1 1 2 4 2 1 2 3 4 5 2 1 3 2 4
扫描二维码关注公众号,回复:
2372196 查看本文章
Sample Output
1 2 1 2 1 2 1 2 3 1 1 |
HDU 6301Distinct Values 【贪心】
猜你喜欢
转载自blog.csdn.net/head_hard/article/details/81181221
今日推荐
周排行