2019 Algorithm

From: 2019-09-30 00:00:00 To: 2019-12-31 00:00:00 Now: 2024-11-15 16:17:58 Status: Public

A - Submit Test용 문제: Insertion Sort

Time Limit: 1s Memory Limit: 128MB

Submissions: 770 Solved: 442
Description

교재 2.1장을 참고하여 Insertion Sort를 구현하시오 (정렬 기준은 오름차순).

 

* kulms '과제및시험'에 예시 코드가 있습니다.

 

Input

Line 0 : the number of elements to be sorted (n)

Line 1~n : an unsorted sequence of integers, one integer per line 

Output

Line 0~(n-1) : a sequence of integers sorted in ascending order, one integer per line

Sample Input
10
4
9
5
7
8
3
6
2
1
0
Sample Output
0
1
2
3
4
5
6
7
8
9