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
—————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— 2015浙江省赛的题目其中一题,不是很难。
题意:给出n张选票,算出得票数最多的人的id,如果有2个及以上的人都获得了最多的选票,则输出Nobody。
思路:计数题。设一个结构体,最后按照票数来排序即可。
#include<iostream>
#include<string>
#include<cstring>
#include<algorithm>
using namespace std; struct node
{
int id;
int cnt;
}a[]; bool cmp(node a, node b)
{
return a.cnt > b.cnt;
} int main()
{
//freopen("D:\\txt.txt", "r", stdin);
int n;
while (cin >> n)
{
while (n--)
{
memset(a, , sizeof(a));
int t,m;
int maxn = ;
cin >> t;
for (int i = ; i < t; i++)
{
cin >> m;
a[m].id = m;
a[m].cnt++;
}
sort(a, a + , cmp);
if (a[].cnt == a[].cnt) cout << "Nobody" << endl;
else cout << a[].id<<endl;
}
}
}

ZOJ 3869 Ace of Aces的更多相关文章

  1. 水题 ZOJ 3869 Ace of Aces

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

  2. 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 ...

  3. 第十二届浙江省大学生程序设计大赛-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 ...

  4. Ace of Aces

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

  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. ZOJ People Counting

    第十三届浙江省大学生程序设计竞赛 I 题, 一道模拟题. ZOJ  3944http://www.icpc.moe/onlinejudge/showProblem.do?problemCode=394 ...

随机推荐

  1. office 2016 install(office2016组件自定义安装激活程序) v5.9.3中文绿色版

    下载地址  http://www.ddooo.com/softdown/71741.htm#dltab office 2016 install是目前下载office2016和office2016组件最 ...

  2. HTML方法

    HTTP 方法:GET 对比 POST 两种最常用的 HTTP 方法是:GET 和 POST. 什么是 HTTP ? 超文本传输协议(HTTP)的设计目的是保证客户端与服务器之间的通信. HTTP 的 ...

  3. JSP表单提交与接收

    JSP表单提交与接收 在Myeclipse中新建web project,在webroot中新建userRegist1.jsp,代码如下 <%@ page contentType="te ...

  4. 1.keras实现-->使用预训练的卷积神经网络(VGG16)

    VGG16内置于Keras,可以通过keras.applications模块中导入. --------------------------------------------------------将 ...

  5. Leetcode: Reorder List && Summary: Reverse a LinkedList

    Given a singly linked list L: L0→L1→…→Ln-1→Ln, reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do th ...

  6. mysql BLOB字段转String的方法

    1.通过sql直接转换 select CONVERT(GROUP_CONCAT(XXX) USING utf8 from usertable; 2.通过程序转换(注:本例用的是springmvc包装并 ...

  7. 查看mysql主外键信息

    SELECT  *FROMinformation_schema.key_column_usage tWHERE t.constraint_schema = '库名称'AND t.constraint_ ...

  8. vue性能优化1--懒加载

    懒加载也叫延迟加载,即在需要的时候进行加载.随用随载.为什么需要懒加载?像vue这种单页面应用,如果没有应用懒加载,运用webpack打包后的文件将会异常的大,造成进入首页时,需要加载的内容过多,时间 ...

  9. HTML ajax 上传文件限制文件的类型和文件大小

    html    <input type="file" name="excel" id="excel_input" accept=&qu ...

  10. 配置mysql主从数据库

    来源地址:https://www.cnblogs.com/alvin_xp/p/4162249.html Mysql主从配置,实现读写分离 大型网站为了软解大量的并发访问,除了在网站实现分布式负载均衡 ...