
#include <iostream>#include <stdio.h>#include <string.h>#include <stack>#include <queue>#include <map>#include <set>#include <vector>#include <math.h>#include <algorithm>using namespace std;#define ls 2*i#define rs 2*i+1#define up(i,x,y) for(i=x;i<=y;i++)#define down(i,x,y) for(i=x;i>=y;i--)#define mem(a,x) memset(a,x,sizeof(a))#define w(a) while(a)#define LL long longconst double pi = acos(-1.0);#define Len 20005#define mod 19999997const int INF = 0x3f3f3f3f;int t,n,a,maxn,flag;struct node{ int cnt,id;}hsh[1005];int cmp(node a,node b){ return a.cnt<b.cnt;};int main(){ int i; scanf("%d",&t); w(t--) { scanf("%d",&n); mem(hsh,0); up(i,0,n-1) { scanf("%d",&a); hsh[a].id = a; hsh[a].cnt++; } sort(hsh,hsh+1001,cmp); if(hsh[1000].cnt==hsh[999].cnt) printf("Nobodyn"); else printf("%dn",hsh[1000].id); } return 0;}欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)