题目传送门
//P1271.cpp

#include <bits/stdc++.h>

using namespace std;
const int N = 1010;
int a[N];
int n, m, tmp;

int main() {
    cin >> n >> m;
    for (int i = 0; i < m; i++) {
        cin >> tmp;
        a[tmp]++;
    }
    for (int i = 1; i <= n; i++)        //号
        for (int j = 0; j < a[i]; j++) //次数
            cout << i << ' ';
    return 0;
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-17
  • 2021-07-20
  • 2021-07-06
猜你喜欢
  • 2021-10-17
  • 2021-12-17
  • 2021-12-01
  • 2021-10-03
  • 2021-09-19
  • 2022-03-04
  • 2021-12-29
相关资源
相似解决方案