| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 147209 | 李朋秦 | 打印每一趟插入排序 | C++ | Wrong Answer | 0 MS | 280 KB | 339 | 2026-02-03 16:14:11 |
#include<bits/stdc++.h> using namespace std; int main() { int n,a[2001],x=0,i,j,t; cin>>n; for(i=0;i<n;i++) cin>>a[i]; for(i=0;i<n;i++){ t=a[i]; for(j=i;j>0;j--){ if(a[j-1]>t){ a[j]=a[j-1]; }else break; } for(int x=0;x<n;x++){ cout<<a[x]<<" "; }cout<<endl; a[j]=t; } return 0; }
------Input------
5 5 2 7 9 1
------Answer-----
2 5 7 9 1 2 5 7 9 1 2 5 7 9 1 1 2 5 7 9
------Your output-----
5 2 7 9 1 5 5 7 9 1 2 5 7 9 1 2 5 7 9 1 2 2 5 7 9