桶排RE+WA不知为何越界40分求助
查看原帖
桶排RE+WA不知为何越界40分求助
580437
golden200812楼主2022/4/28 15:53

#为什么桶排序会re#

#include<bits/stdc++.h>
using namespace std;
long long n,a[1100],m;
int main(){
	cin>>n>>m;
	for(int i=1;i<=m;++i){
		int b;
		cin>>b;
		a[b]++;
	}
	for(int i=1;i<=m;++i){
		if(a[i]>0){
			for(int j=1;j<=a[i];++j){
				cout<<i<<" ";
			}
		}
	}
	return 0;
} 

求助

2022/4/28 15:53
加载中...