Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
118176 | 邓芷淇 | 插入排序 | C++ | 通过 | 100 | 0 MS | 256 KB | 384 | 2023-12-28 20:36:08 |
#include<bits/stdc++.h> #include<algorithm> using namespace std; typedef unsigned long long ull; typedef long long ll; int n,x,a[10004]; bool b=1; int main() { cin>>n; for(int i=1;i<=n;i++) { cin>>a[i]; } cin>>x; for(int i=1;i<=n;i++) { if(a[i]>x&&b) { b=0; cout<<x<<" "; } cout<<a[i]<<" "; } if(b) { cout<<x; } return 0; }