提交时间:2026-06-06 22:12:31
运行 ID: 443812
#include <iostream> using namespace std; int cnt[1005]; int main() { ios::sync_with_stdio(false); cin.tie(0); int n, m; cin >> n >> m; for (int i = 0; i < m; i++) { int x; cin >> x; cnt[x]++; } for (int i = 1; i <= n; i++) { while (cnt[i]--) { cout << i << " "; } } return 0; }