博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
SDNU 1095.Ignatius and the Princess IV(水题)
阅读量:6816 次
发布时间:2019-06-26

本文共 1556 字,大约阅读时间需要 5 分钟。

Description

"OK, you are not too bad, em... But you can never pass the next test." feng5166 says.
"I will tell you an odd number N, and then N integers. There will be a special integer among them, you have to tell me which integer is the special one after I tell you all the integers." feng5166 says.
"But what is the characteristic of the special integer?" Ignatius asks.
"The integer will appear at least (N+1)/2 times. If you can't find the right integer, I will kill the Princess, and you will be my dinner, too. Hahahaha....." feng5166 says.
Can you find the special integer for Ignatius?

Input

The input contains several test cases. Each test case contains two lines. The first line consists of an odd integer N(1<=N<=999999) which indicate the number of the integers feng5166 will tell our hero. The second line contains the N integers which are no more than 2147483647. The input is terminated by the end of file.

Output

For each test case, you have to output only one line which contains the special number you have found.

Sample Input

51 3 2 3 3111 1 1 1 1 5 5 5 5 5 571 1 1 1 1 1 1

Sample Output

351
#include 
#include
#include
#include
#include
#include
#include
using namespace std;#define ll long longint n, a[1000000+8], sign[1000000+8];int main(){ while(~scanf("%d", &n)) { memset(sign, 0, sizeof(sign)); int miao, ga; for(int i = 0; i

 

转载于:https://www.cnblogs.com/RootVount/p/10891071.html

你可能感兴趣的文章
My_Base_notes
查看>>
Node assert断言学习及mocha框架与travisCI初探
查看>>
大话转岗 PHP 开发小结
查看>>
React的状态管理
查看>>
寻找一种易于理解的一致性算法(扩展版)下
查看>>
MySQL - 高可用性:少宕机即高可用?
查看>>
2018电影票房分析-谁才是票房之王
查看>>
程序员可以干到多少岁?
查看>>
Storm系列(六)storm和kafka集成
查看>>
东南亚的招聘骗局,程序员请注意!
查看>>
Android 获得View宽高的几种方式
查看>>
iOS正则表达式
查看>>
关于javascript的this指向问题
查看>>
Promise的理解和用法
查看>>
java B2B2C Springboot电子商城系统-高可用的服务注册中心
查看>>
Dubbo的总体架构
查看>>
Spring Cloud微服务架构代码结构详细讲解
查看>>
以太经典硬分叉:矿工欢喜、投资者欢庆、社区高兴的“三赢”之举
查看>>
我的友情链接
查看>>
LVS启(禁)用成员
查看>>