段错误,60pts,求调,谢谢
查看原帖
段错误,60pts,求调,谢谢
1015576
shit_mountain楼主2024/7/4 20:48
#include <bits/stdc++.h>
const int MAXN = 100009;
using namespace std;
int h[MAXN];
int main() {
    int n;
    cin >> n;
    for(int i=1; i<=n; i++){
        int x;
        cin >> x;
        h[x] ++;
    }
    for(int i=1; i<=n; i++){
        if(h[i]) {
            for(int j=1; j<=h[i]; j++){
                cout << i << ' ';
            }
        }
    }
}

前两个点RE,Thanks♪(・ω・)ノ

2024/7/4 20:48
加载中...