Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
67037 胡海峰老师 插入排序 Python3 Accepted 242 MS 3992 KB 259 2024-03-13 09:52:47

Tests(10/10):


Code:

n = int(input()) a = list(map(int,input().split())) """ 5 5 4 2 1 3 """ for i in range(1,n): next = a[i] j = i-1 while j>=0 and a[j]>next: a[j+1]=a[j] j-=1 a[j+1]=next b = [str(t) for t in a] print(' ' .join(b))