[READ-ONLY] Mirror of https://github.com/shuuji3/competitive-programming. 馃洬 Codes submitted to competitive programming platforms
aizu-online-jadge aoj atcoder hackerrank leetcode
0

Configure Feed

Select the types of activity you want to include in your feed.

1def print_list(l): 2 print(' '.join(map(str, l))) 3 4 5n = int(input()) 6l = list(map(int, input().split())) 7 8print_list(l) 9 10for i in range(1, n): 11 v = l[i] 12 j = i - 1 13 while j >= 0 and l[j] > v: 14 l[j + 1] = l[j] 15 j -= 1 16 l[j + 1] = v 17 print_list(l)