1 solutions

  • 0
    @ 2024-3-11 11:43:55

    #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; }

    • 1

    Information

    ID
    4718
    Time
    1000ms
    Memory
    125MiB
    Difficulty
    2
    Tags
    # Submissions
    37
    Accepted
    18
    Uploaded By