题号:NC218908
时间限制:C/C++/Rust/Pascal 2秒,其他语言4秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld
题目描述
You are given a list of integers

and a number k.
It is guaranteed that each i from 1 to k appears in the list at least once.
Find the lexicographically smallest subsequence of x that contains
each integer from 1 to k exactly once.
输入描述:
The first line will contain two integers n and k, with
.
The following n lines will each contain an integer
with
.
输出描述:
Write out on one line, separated by spaces, the lexicographically smallest
subsequence of x that has each integer from 1 to k exactly once.