求助各位大佬,可以过样例,但提交之后都是超时
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <unistd.h>
#define N 1000001
int main(){
int a[N];
int n, i, b;
scanf("%d", &n);
for(i = 0; i < n; i++){
scanf("%d", &a[i]);
}
int max = a[0];
for(i = 0; i < n-1; i++){
if(max < a[i+1]){
max = a[i+1];
}
}
int t = 0, p = 0;
int c[N];
for(t = 0; t <= max; t++){
for(i = 0; i < n; i++){
if(t == a[i]){
p++;
}
}
c[t] = p;
p = 0;
}
for(i = 0; i <= max; i++){
printf("%d\n", c[i]);
}
return 0;
}