| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 365949 | 小林老师 | 【C4-4】n个一位数能够组成的最小数 | C++ | Accepted | 100 | 4 MS | 244 KB | 425 | 2025-12-06 08:55:46 |
#include<bits/stdc++.h> using namespace std; int a[105],n,mi,s; int main(){//n个一位数能够组成的最小数 cin>>n; for(int i=1;i<=n;i++){ cin>>a[i]; if(a[i]==0) s++; } for(int i=1;i<n;i++){ int mi=i; for(int j=i+1;j<=n;j++) if(a[j]<a[mi]) mi=j; if(i!=mi) swap(a[i],a[mi]); } cout<<a[s+1]; for(int i=1;i<=n;i++){ if(i==s+1) continue; cout<<a[i]; } return 0; }