Description

There is a mysterious organization called Time-Space Administrative Bureau (TSAB) in the deep universe that we humans have not discovered yet. This year, the TSAB decided to elect an outstanding member from its elite troops. The elected guy will be honored with the title of "Ace of Aces".

After voting, the TSAB received N valid tickets. On each ticket, there is a number Ai denoting the ID of a candidate. The candidate with the most tickets nominated will be elected as the "Ace of Aces". If there are two or more candidates have the same number of nominations, no one will win.

Please write program to help TSAB determine who will be the "Ace of Aces".

Input

There are multiple test cases. The first line of input contains an integer T indicating the number of test cases. For each test case:

The first line contains an integer N (1 <= N <= 1000). The next line contains N integers Ai (1 <= Ai <= 1000).

Output

For each test case, output the ID of the candidate who will be honored with "Ace of Aces". If no one win the election, output "Nobody" (without quotes) instead.

Sample Input

3
5
2 2 2 1 1
5
1 1 2 2 3
1
998

Sample Output

2
Nobody
998
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std; int a[];
int f[]; int main()
{
int t,n,x,flag;
int maxx;
scanf("%d",&t);
while(t--)
{
scanf("%d",&n);
memset(f,,sizeof(f));
maxx=-;flag=;
for(int i=;i<n;i++)
{
scanf("%d",&a[i]);
f[a[i]]++;
}
for(int i=;i<;i++)
{
if(f[a[i]]>maxx)
{
maxx=f[a[i]];
x=a[i];
}
}
for(int i=;i<;i++)
if(f[a[i]]==maxx&&a[i]!=x)
flag++;
if(flag>)
printf("Nobody\n");
else
printf("%d\n",x);
}
return ;
}

Ace of Aces的更多相关文章

  1. zjuoj The 12th Zhejiang Provincial Collegiate Programming Contest Ace of Aces

    http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5493 The 12th Zhejiang Provincial ...

  2. 第十二届浙江省大学生程序设计大赛-Ace of Aces 分类: 比赛 2015-06-26 14:25 12人阅读 评论(0) 收藏

    Ace of Aces Time Limit: 2 Seconds Memory Limit: 65536 KB There is a mysterious organization called T ...

  3. ZOJ 3869 Ace of Aces

    There is a mysterious organization called Time-Space Administrative Bureau (TSAB) in the deep univer ...

  4. 水题 ZOJ 3869 Ace of Aces

    题目传送门 水题,找出出现次数最多的数字,若多个输出Nobody //#include <bits/stdc++.h> //using namespace std; #include &l ...

  5. 140 - The 12th Zhejiang Provincial Collegiate Programming Contest(浙江省赛2015)

      Ace of Aces Time Limit: 2 Seconds      Memory Limit: 65536 KB There is a mysterious organization c ...

  6. 【windows 访问控制】十一、C# 实操 对象 System.Security.AccessControl 命名空间

    AccessControl 命名空间 结构图 解说: DirectorySecurity=目录ACLFileSecurity=文件ACLFileSystemAuditRule=目录和文件中SACL中的 ...

  7. ACE的构建(VC++6.0环境)

    ACE的构建(VC++6.0环境)Windows下ACE的构建1. 将ACE-5.5.zip解压到所需的安装目录,此处以E:/为例,解压后形成ACE_wrappers文件夹,因此ACE将会存在于ACE ...

  8. Windows Server 2008及以上系统磁盘无法查看(About UAC and ACE)

    在windows Server2008及以上系統,如果UAC Enabled,ACE列表中不會包含Administrators成員的SID,所以即使你是administrators的成員,也無法訪問D ...

  9. Microsoft ACE OLEDB 12.0 数据库连接字符串

    Excel 97-2003 Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\myFolder\myOldExcelFile.xls;Extended ...

随机推荐

  1. mul16

    设计思想:乘法运算本身就可以看做是一个移位相加的过程               1 1 0 1 0     = 26*              1 0 1 1 1    = 23          ...

  2. 浏览器hack总结 详细的浏览器兼容性解决方法

    由于各浏览器对页面的解析不同,会导致页面在不同浏览器中显示的样式不一致,为了保持页面的统一,经常需要对浏览器进行兼容性问题的调试. CSS Hack 面对浏览器诸多的兼容性问题,经常需要通过CSS样式 ...

  3. Python 数据处理扩展包: numpy 和 pandas 模块介绍

    一.numpy模块 NumPy(Numeric Python)模块是Python的一种开源的数值计算扩展.这种工具可用来存储和处理大型矩阵,比Python自身的嵌套列表(nested list str ...

  4. JavaScript 、ECMAScript、commonJS 发展历史 与标准化发展

    本文介绍下JavaScript和 ECMAScript的诞生及发展历史,以及标准化过程. 一.JavaScript诞生 1994年,网景公司(Netscape)发布了Navigator浏览器0.9版. ...

  5. 网站开启gzip的方法

    .如果空间支持Zlib压缩文件,可用php.ini方法 这个方法比较简单,压缩率也较高,可达75%左右.新建一个名为 php.ini 的文件,添加以下代码,保存后上传至网站根目录即可. output_ ...

  6. eclipse 找不到application选项

    处理如下:Window-Preferences-Run/Debug-Perspectives 中的 And Build修改为如下

  7. 基于visual Studio2013解决算法导论之052深度优先

     题目 深度优先 解决代码及点评 // 深度优先.cpp : 定义控制台应用程序的入口点. // // 图的邻接表表示.cpp : 定义控制台应用程序的入口点. // #include < ...

  8. 非确定有限状态自动机的构建(二)——将CharVal转换为NFA

    保留版权,转载注明出处:潘军彪的个人博客(http://blog.csdn.net/panjunbiao/article/details/9378933) 将上下文无关文法读入内存之后,可以将它转换成 ...

  9. Android 传感器开发

    如今的智能手机都配备了各种各样的传感器,本文将介绍Android SDK提供的传感器开发接口,并通过简单实例展示怎样使用这些接口. Andriod SDK传感器相关类 android SDK提供的与传 ...

  10. 安卓开发-Activity中finish() onDestroy() 和System.exit()的区别

    Activity.finish()Call this when your activity is done and should be closed. 在你的activity动作完成的时候,或者Act ...