描述

Whoooa! There is a spy in Marjar University. All we know is that the spy has a special ID card. Please find him out!

输入

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 a integer N (3 <= N <= 100), which describes that there are N students need to be checked.

The second line contains N integers indicating the ID card number of N students. All ID card numbers are 32-bit integers.

输出

For each test case, output the ID card number which is different from others.

样例输入

3
10
1 1 1 1 1 1 1 1 6 1
3
9 9 8
5
90016 90016 90016 2009 90016

样例输出

6

8

2009

排序 排序 排序 sort sort sort ,别再冒泡了,哦哦,对了,头文件是#include
<algorithm>

#include <stdio.h>
#include <algorithm>
using namespace std;
int main()
{
int i,n,s;
int a[];
scanf("%d",&s);
while(s--)
{
scanf("%d",&n);
for(i=;i<n;i++)
{
scanf("%d",&a[i]);
}
sort(a,a+n);
if(a[]==a[])
printf("%d\n",a[n-]);
else
printf("%d\n",a[]);
}
}

TZOJ Find the Spy的更多相关文章

  1. UVA - 1025 A Spy in the Metro[DP DAG]

    UVA - 1025 A Spy in the Metro Secret agent Maria was sent to Algorithms City to carry out an especia ...

  2. Manthan, Codefest 16 -C. Spy Syndrome 2

    time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standa ...

  3. 用PowerMock spy mock private方法

    在实际的工作中,经常碰到只需要mock一个类的一部分方法,这时候可以用spy来实现. 被测类: public class EmployeeService { public boolean exist( ...

  4. Jasmine测试ng Promises - Provide and Spy

    jasmine提供了很多些很实用的处理Promises的方法,首先我们来考虑下面的这个例子: angular.module("myApp.store").controller(&q ...

  5. UVa 1025 A Spy in the Metro(动态规划)

    传送门 Description Secret agent Maria was sent to Algorithms City to carry out an especially dangerous ...

  6. UVA1025---A Spy in the Metro(DP)

    http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=35913 Secret agent Maria was sent to Alg ...

  7. ZOJ 3860: - Find the Spy

    3860 - Find the Spy Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%lld & %llu S ...

  8. 如何使用SPY++查找

    自动化测试中,如果需要做UI automation的时候往往需要抓取object的工具.实际上这种工具有很多,认识的大牛使用SPY++,于是我也选择了这个.下面列出基本使用方法.有点像XACC spy ...

  9. SPY++的使用

    百度百科Spy++ 使用的是VS2010.net自带的功能,可以从开始菜单中打开.

随机推荐

  1. VMware Centos7 桥接 DHCP无法获得IP

    问题描述 VMware Centos7 桥接模式下,虚拟机无法获得IP,无法联网 解决方案 网络设置为DHCP自动获取IP 查看主机(不是虚拟机)的相关服务是否打开,主要是VMware DHCP 这个 ...

  2. 这是一篇致力于解决Linux小白无法安装tunctl工具的文章

    计算机网络——搭建Linux下的实验环境并成功安装tunctl 各位如果是来解决安装tunctl的问题的,请直接到2.2部分的内容. 这个学期终于迎来了计算机网络这门课程,也终于能够进一步了解让我无数 ...

  3. python控制台实现打印带颜色的字体

    控制台颜色分类: 数值表示的参数含义: 显示方式: 0(默认值).1(高亮).22(非粗体).4(下划线).24(非下划线). 5(闪烁).25(非闪烁).7(反显).27(非反显)前景色: 30(黑 ...

  4. 关于键盘事件-查询:有多个input框,任意一个支持enter键查询

    应用场景:同一个界面有多个input框支持任意一个Enter查询. 实现:在input框中添加onkeypress="函数名()". 函数里面编写对应键盘code值,在里面直接调用 ...

  5. MySQL常见面试题索引、表设计

    正确使用索引的条件 1.建立索引的列的重复度不能太高 2.条件列不能参与计算 3.不能使用函数 4.条件中不能使用范围 5.不要使用like '%c' 6.条件中用or a=0 or b=1 or c ...

  6. MyCat基本知识

    一.Mycat基本元素 1.逻辑库,mycat中存在,对应用来说相当于mysql数据库,后端可能对应了多个物理数据库,逻辑库中不保存数据 2.逻辑表,逻辑库中的表,对应用来说相当于mysql的数据表, ...

  7. asp.net MVC3.0 中@Html.Partial,@Html.Action,@Html.RenderPartial,@Html.RenderAction

    asp.net MVC3.0 中@Html.Partial,@Html.Action,@Html.RenderPartial,@Html.RenderAction 1.带有Render的方法返回值是v ...

  8. 【Nginx】centos7 yum命令安装nginx

    安装nginx 首先我们需要使用root用户进行操作 第一步:添加nginx存储库 sudo yum install epel-release 出现如下图说明成功: 第二步:安装nginx sudo ...

  9. J2EE项目中,servlet跳转到相应的JSP页面后,JSP页面丢失了样式效果

    原因: js和css的引用路径是相对路径.跳转后路径改变. 解决方法: 先在head标签中加入一下代码 <% String path = request.getContextPath(); St ...

  10. 五、数据类型(1):整数&&带小数点的数

    1.整数 int printf("%d",...); scanf("%d",&...); 2.带小数点的数 double printf("%f ...