#include <stdio.h>
#include <stdlib.h>
int main()
{
int a[1001];
int m,n,x,max=-1,num,i;
scanf("%d %d",&m,&n);
for (i=0;i<n;i++)
{
a[i]=0;
}
for (i=0;i<n;i++)
{
scanf("%d",&x);a[x-1]++;
}
for (i=0;i<m;i++)
{
if (a[i]>max) {max=a[i];num=i+1;}
}
printf("%d\n%d",num,max);
return 0;
}
SDUT 1294选票统计
猜你喜欢
转载自blog.csdn.net/Here_SDUT/article/details/102882753
今日推荐
周排行