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自带的功能,可以从开始菜单中打开.
随机推荐
- [Alink漫谈之三] AllReduce通信模型
[Alink漫谈之三] AllReduce通信模型 目录 [Alink漫谈之三] AllReduce通信模型 0x00 摘要 0x01 MPI是什么 0x02 Alink 实现MPI的思想 0x03 ...
- Qt标准对话框按钮文字等设置为中文
问题描述:QMessageBox.QColorDialog等标准对话框按钮显示都是英文 设置中文方法如下: 1)拷贝Qt安装目录下的qt_zh_CN.qm和qt_zh_CN.ts文件到工程目录中 2) ...
- jbpm4.4 timer的使用
今天学习了jbpm4 的timer使用,一直测试都不成功:配置如下: <?xml version="1.0" encoding="UTF-8"?> ...
- 容器技术之LXC WEB管理工具LXC WEB Panel
前一篇博文中主要说了下,lxc容器在Linux上的简单管理,回顾请参考https://www.cnblogs.com/qiuhom-1874/p/12901493.html:今天我们来介绍下lxc的图 ...
- MYSQL8 常用操作
开启root账号远程访问 方法1 mysql'; //修改密码认证方式为mysql_native_password mysql> GRANT ALL ON *.* TO 'root'@'%'; ...
- 【雕爷学编程】Arduino动手做(42)---PM2.5粉尘传感器
37款传感器与模块的提法,在网络上广泛流传,其实Arduino能够兼容的传感器模块肯定是不止37种的.鉴于本人手头积累了一些传感器和模块,依照实践(动手试试)出真知的理念,以学习和交流为目的,这里准备 ...
- JS的函数和对象一
1.递归 在函数的内部调用自身,默认是一个无限循环. 2.匿名函数 没有名称的函数 function(){ } (1)创建函数 函数声明 function fn1(){ } 函数表达式 va ...
- jenkins+gitee+ssh自动化部署
一.准备环境 1,配置maven(MAVEN_HOME) 2,配置jdk(JAVA_HOME)我这里用的jdk1.8.0_121,之前碰到过一次别的版本的jdk在启动tomcat无法解析https情况 ...
- MySQL(6)— 事务
六.事务 ACID: 原子性.一致性.隔离性和持久性 原子性(atomicity) :一组事务,不能再细分了,其中的sql, 要么全部提交成功,要么全部失败回滚,不能只提交其中的一部分操作. 一致性( ...
- springboot使用Jwt处理跨域认证问题
在前后端开发时为什么需要用户认证呢?原因是由于HTTP协定是不存储状态的,这意味着当我们透过账号密码验证一个使用者时,当下一个request请求时他就把刚刚的资料忘记了.于是我们的程序就不知道谁是谁了 ...