全部TLE,decc++测试样例能过
查看原帖
全部TLE,decc++测试样例能过
1212451
chenyifan12楼主2024/3/30 17:43

全部TLE,decc++测试样例能过,代码如下:

#include<bits/stdc++.h>
using namespace std;
int main(){
	long long max=-1000000,c[100010],a,d=0;
	cin>>a;
	for(int i=1;i<=a;i++){
		cin>>c[i];
		if(max<c[i]){
			max=c[i];
		}
	}
	for(int i=0;i<=max;i++){
		d=0;
		for(int j=1;j<=a;j++){
			if(c[j]==i){
				d++;
				}
		}
		cout<<d<<endl;
	}
	return 0;
}
2024/3/30 17:43
加载中...