Logo C++ Online Judge

C++

时间限制:1 s 空间限制:512 MB
TA: 苏凯
Statistics

Input Two integers $n,k$ in the first line. Then the second line consists of $n$ integers $\in[1,n]$.

Output $n$ integers representing the result after $k$ rounds of bubble sort.

Constraints: $0\le k\le n,1\le n\le 1000$.

Example Input 1

3 1
2 3 1

Example Output 1

2 1 3

Extra Excercise

What if $n\le 10^5$?