#include <bits/stdc++.h> using namespace std;
int main() { int n, m, t, a[1005]= {0}; cin >> n >> m; for (int i=0; i<m; i++) { cin >> t; a[t]++; } for (int i=1; i<=n; i++) { for (int j=1; j<=a[i]; j++) { cout << i << " "; } } return 0; }
By signing up a HFOJ universal account, you can submit code and join discussions in all online judging services provided by us.
Using your HFOJ universal account