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自带的功能,可以从开始菜单中打开.
随机推荐
- linux --vim 补充 .vimrc
1.今天发现了一个新的功能.vimrc 1.这个是一个个人配置文件,可以在这个里面首先对vim进行一些设置呢 如果系统没有.vimrc文件,可以自己创建一个,touch .vimrc 举个栗子,我在. ...
- 前端面试题-WebSocket的实现和应用
(1)什么是WebSocket? WebSocket是HTML5中的协议,支持持久连续,http协议不支持持久性连接.Http1.0和HTTP1.1都不支持持久性的链接,HTTP1.1中的keep-a ...
- vue与其他框架对比
https://cn.vuejs.org/v2/guide/comparison.html 1. vue 框架的特点? MVVM框架模式 轻量级,灵活,容易上手 数据驱动 组件化(单文件组件) 插件化 ...
- P1251 餐巾计划问题 网络流
P1251 餐巾计划问题 #include <bits/stdc++.h> using namespace std; typedef long long ll; , inf = 0x3f3 ...
- 数据结构----栈stack
栈的概念与数据结构 栈(有时称为“后进先出栈”)是一个元素的有序集合,其中添加移除新元素总发生在同一端.这一端通常称为“顶部”.与顶部对应的端称为“底部”.栈的底部很重要,因为在栈中靠近底部的元素是存 ...
- 王玉兰201771010128实验二 Java基本程序设计
第一部分:理论知识学习部分: (1)标识符:标识符由字母.下划线.美元符号和数字组成,且第一个符号不能为数字.Hello.$1234.程序名.www_123都是合法标识符.标识符可用作类名.变量名. ...
- Spring Boot 教程(2) - Mybatis
Spring Boot 教程 - Mybatis 1. 什么是Mybatis? MyBatis 是一款优秀的持久层框架,它支持自定义 SQL.存储过程以及高级映射.MyBatis 免除了几乎所有的 J ...
- shrio的springboot完整配置
package com.zys.sys.config; import java.util.HashMap; import java.util.Map; import javax.servlet.Fil ...
- Kubernetes实战 - 从零开始搭建微服务 - 1.5 提高可用性-发布多节点的Node/Express网络应用程序
1.5 提高可用性-发布多节点的Node/Express网络应用程序 Kubernetes实战 - 从零开始搭建微服务 前言 在上一篇文章中,已经学习了如何简单地开发一个单层网络应用.[Kuberne ...
- 【C++】运算符优先级和结合性
从上表可以大致总结这样一个规律: 优先级 运算符 高 初等运算符 | 单目运算符 | 算术运算符(先乘除,后加减) | 关系运算符 | 逻辑运算符(不包括!) | 条件运算符 ↓ 赋值运算符 低 逗号 ...