| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 134571 | 梁煜然 | 第k小数1 | C++ | Wrong Answer | 0 | 1000 MS | 636 KB | 437 | 2024-03-02 16:18:42 |
#include<iostream> #include<cstdio> int n,a[100001],k; void select_sort(int n){ int i,j,minn,t; for(int i=1;i<n;i++){ minn=i; for(int j=i+1;j<=n;j++){ if(a[j]<a[minn])minn=j; } if(minn!=i){ t=a[i]; a[i]=a[minn]; a[minn]=t; } } } using namespace std; int main(){ cin>>n; cin>>k; for(int i=1;i<=n;i++){ cin>>a[i]; } select_sort(n); for(int i=1;i<=k;i++){ cout<<a[i]<<" "; } }