Problem D. Distinct Values
时间限制 2000 ms
内存限制 32 MB
Chiaki has an array of $n$ positive integers. You are told some facts about the array: for every two elements $a_i$ and $a_j$ in the subarray $a_{l..r}$ ($l \le i < j \le r$), $a_i \ne a_j$ holds.
Chiaki would like to find a lexicographically minimal array which meets the facts.
输入数据
输出数据
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.
样例输入
复制
3
2 1
1 2
4 2
1 2
3 4
5 2
1 3
2 4
样例输出
$ Mathjax font initiator $