提交时间:2024-08-19 22:06:56
运行 ID: 168058
#include <iostream> using namespace std; const int MAXN = 10000005; long long cnt[MAXN]; int main() { long long n; cin >> n; long long mx = 0, mn = MAXN; for (long long i = 0; i < n; i++) { long long x; cin >> x; cnt[x]++; if (x > mx) mx = x; if (x < mn) mn = x; } for (long long i = mn; i <= mx; i++) { while (cnt[i] > 0) { cout << i << " "; cnt[i]--; } } return 0; }