mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
808996d897
5100-5199
34 lines
604 B
C++
34 lines
604 B
C++
#include <iostream>
|
|
#include <cstdio>
|
|
#include <cstring>
|
|
using namespace std;
|
|
int a[110];
|
|
int main()
|
|
{
|
|
int t,n;
|
|
scanf("%d",&t);
|
|
while(t--)
|
|
{
|
|
scanf("%d",&n);
|
|
memset(a,0,sizeof(a));
|
|
int max=0;
|
|
for(int i=0;i<n;i++)
|
|
{
|
|
int x;
|
|
scanf("%d",&x);
|
|
a[x]++;
|
|
if(a[x]>max)
|
|
max=a[x];
|
|
}
|
|
int ans;
|
|
for(int i=0;i<=n;i++)
|
|
if(a[i]==max)
|
|
{
|
|
ans=i;
|
|
break;
|
|
}
|
|
printf("%d\n",ans);
|
|
}
|
|
return 0;
|
|
}
|