1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <string.h> 4 struct node 5 { 6 int date;//结构体。 7 } a[1001]; 8 int main() 9 { 10 int i,n,m,t,max,temp; 11 scanf("%d %d",&n,&m); 12 memset(a,0,sizeof(a)); 13 max=0; 14 for(i=0; i<m; i++) 15 { 16 scanf("%d",&t); 17 a[t].date++; 18 if(a[t].date>max)max=a[t].date,temp=t; 19 } 20 printf("%d %d",temp,max); 21 return 0; 22 }