Problem F: 数字统计
Time Limit: 1 Sec Memory Limit: 128 MB
Submit: 10610 Solved: 5030
[Submit][Status]
Description
给出一些数字,统计出现最多的数字的次数。
Input
输入中第一行包含一个N,0 < N <= 500000。
后面N行每行包含一个数字k,0<=k<=200000。
Output
输出出现次数最多的数字的个数。
Sample Input
5
1
1
2
3
4
Sample Output
2
HINT
Append Code
#include<stdio.h>
#include<string.h>
int main()
{
int n,i,a[500001],b,c=0;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
scanf("%d",&b);
a[b]++;
if(a[b]>c)
c=a[b];
}
printf("%d\n",c);
return 0;
}