Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
86510 丁俊杰 插入排序 Python3 Accepted 373 MS 4260 KB 233 2024-07-25 20:18:43

Tests(10/10):


Code:

n=int(input()) a=list(map(int,input().split())) for i in range(1,n): #取索引从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 print(*a)