TZOJ Find the Spy
描述
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的更多相关文章
- 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 ...
- Manthan, Codefest 16 -C. Spy Syndrome 2
time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standa ...
- 用PowerMock spy mock private方法
在实际的工作中,经常碰到只需要mock一个类的一部分方法,这时候可以用spy来实现. 被测类: public class EmployeeService { public boolean exist( ...
- Jasmine测试ng Promises - Provide and Spy
jasmine提供了很多些很实用的处理Promises的方法,首先我们来考虑下面的这个例子: angular.module("myApp.store").controller(&q ...
- UVa 1025 A Spy in the Metro(动态规划)
传送门 Description Secret agent Maria was sent to Algorithms City to carry out an especially dangerous ...
- 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 ...
- ZOJ 3860: - Find the Spy
3860 - Find the Spy Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%lld & %llu S ...
- 如何使用SPY++查找
自动化测试中,如果需要做UI automation的时候往往需要抓取object的工具.实际上这种工具有很多,认识的大牛使用SPY++,于是我也选择了这个.下面列出基本使用方法.有点像XACC spy ...
- SPY++的使用
百度百科Spy++ 使用的是VS2010.net自带的功能,可以从开始菜单中打开.
随机推荐
- AT命令集详解
1.2 AT的优点. 命令简单易懂,并且采用标准串口来收发AT命令,这样对设备控制大大简化了,转换成简单串口编程了. AT命令提供了一组标准的硬件接口--串口.这个简化的硬件设计.较新的电信网络模块, ...
- day04:购物车的练习(20170216)
product_list = [ ('IPhone',5900), ('Mac pro',9800), ('Bike',800), ('Watch',16000), ('Coffee',35), (' ...
- Postgres的索引01
一.PG 9.3有以下索引类型 1.b-tree 1.1支持前导模糊查询,如xxx%或者^'xxx' 1.2忽略大小写字符前导模糊查询,如ILIKE 'XXX%'或者~*'^xxx' 1.3支持常见的 ...
- 阿里面试官必问的12个MySQL数据库基础知识,哪些你还不知道?
数据库基础知识 1.为什么要使用数据库 (1)数据保存在内存 优点: 存取速度快 缺点: 数据不能永久保存 (2)数据保存在文件 优点: 数据永久保存 缺点: 1)速度比内存操作慢,频繁的IO操作. ...
- MyBatis——com.mysql.cj.exceptions.InvalidConnectionAttributeException
报错信息 Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.c ...
- ExtJS定时和JS定时
ExtJS定时 //定时刷新待办事宜状态 var task={ run:function(){ //执行的方法或方法体 }, interval:5*60*1000 //5分钟 } //定时启动 Ext ...
- Nginx301重定向
1)301重定向,把blog.moonsbird.com和moonsbirl.com合并,并把之前的域名也一并合并. 有两种实现方法,第一种方法是判断nginx核心变量host(老版本是http_ho ...
- java中的redis常用操作
https://blog.csdn.net/lixiaoxiong55/article/details/81592800 超详细版 常规操作 public class TestReidsComm ...
- Javascript输入输出语句
方法 说明 归属 alert(msg) 浏览器弹出警示框 浏览器 console.log(msg) 浏览器控制台打印输出信息 浏览器 prompt(info) 浏览器弹出输入框,用户可以输入 浏览器 ...
- NOIP 2017 P3959 宝藏 (状态压缩DP板子)
洛谷题目传送门!! 题目的N这么小,当然是选择用状压DP啦! 等等,我好像不会状缩.... 首先,我们当然是要写状态转移方程了!! 那么,如果我们设 f[s] 状态s下,所要的最小花费,那么很显 ...