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自带的功能,可以从开始菜单中打开.
随机推荐
- java ->IO流_字符流
字符流 经过前面的学习,我们基本掌握的文件的读写操作,在操作过程中字节流可以操作所有数据,可是当我们操作的文件中有中文字符,并且需要对中文字符做出处理时怎么办呢? 字节流读取字符的问题 通过以下程序读 ...
- Redux:中间件
redux中间件概念 比较容易理解. 在使用redux时,改变store state的一个固定套路是调用store.dispatch(action)方法,将action送到reducer中. 所谓中间 ...
- scrapy框架简介与安装启动
Scrapy 是一个专业的.高效的爬虫框架,它使用专业的 Twisted 包(基于事件驱动的网络引擎包)高效地处理网络通信,使用 lxml(专业的 XML 处理包).cssselect 高效地提取 H ...
- ABAP基础1:概念
包(Package)也称作开发类,是为了将程序等对象根据功能划分,进行区分和管理而导入的概念 每一个开发对象,如程序.类,都要隶属一个包,包一般隶属于某一个模块 每个包拥有一个CTS号,CTS号用于系 ...
- 【Java8新特性】关于Java8的Stream API,看这一篇就够了!!
写在前面 Java8中有两大最为重要的改变.第一个是 Lambda 表达式:另外一个则是 Stream API(java.util.stream.*) ,那什么是Stream API呢?Java8中的 ...
- 王艳 201771010127《面向对象程序设计(java)》第八周学习总结
一:理论部分. 1.接口:Java为了克服单继承的缺点,Java使用了接口,一个类可以实现一个或多接口.(接口不是类,而是对类的一组需求描述,它由常量和一组抽象方法组成) 1)通常,接口名称以able ...
- hdu4746莫比乌斯反演进阶题
Mophues Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 327670/327670 K (Java/Others)Total S ...
- 二、第一个C程序:Hello World!
如何在Dev C++中编辑.编译和运行程序? 一.打开Dev C++ 二.在上面编辑窗口中输入以下代码 #include<stdio.h> int main() { printf(&quo ...
- os.walk()的实际应用
背景: 通过Mobaxterm从本地上传虹膜数据,一共79个类,每类里包含左右眼各400张数据,总共63200张,上传期间断网不确定是否传完. 思路: 1.首先遍历总类别数是否正确,若不足79,返回“ ...
- vue端口号被占用
今天在启动一个Vue项目的时候,遇到了一个问题. 得知是Vue项目端口号占用的问题. 解决方法: 换一个端口号. 在调用 npm run dev 的时候,实际上是在调用根目录下的 package ...