记录编号 286593 评测结果 AAAAAAAAAA
题目名称 979.谁是卧底 最终得分 100
用户昵称 AntiLeaf 是否通过 通过
代码语言 C++ 运行时间 0.000 s
提交时间 2016-07-31 19:57:22 内存使用 0.00 MiB
显示代码纯文本
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<map>
using namespace std;
namespace mine{
	inline int getint(){
		static int __c,__x;
		static bool __neg;
		__x=0;
		__neg=false;
		do __c=getchar();while(__c==' '||__c=='\n'||__c=='\r'||__c=='\t');
		if(__c=='-'){
			__neg=true;
			__c=getchar();
		}
		for(;__c>='0'&&__c<='9';__c=getchar())__x=__x*10+(__c^48);
		if(__neg)return -__x;
		return __x;
	}
	inline long long getll(){
		static long long __x;
		static char __c;
		static bool __neg;
		__x=0;
		__neg=false;
		do __c=getchar();while(__c==' '||__c=='\n'||__c=='\r'||__c=='\t');
		if(__c=='-'){
			__neg=true;
			__c=getchar();
		}
		for(;__c>='0'&&__c<='9';__c=getchar())__x=__x*10+(__c^48);
		if(__neg)return -__x;
		return __x;
	}
	inline unsigned long long getull(){
		static unsigned long long __x;
		static char __c;
		__x=0;
		do __c=getchar();while(__c==' '||__c=='\n'||__c=='\r'||__c=='\t');
		for(;__c>='0'&&__c<='9';__c=getchar())__x=__x*10+(__c^48);
		return __x;
	}
	inline void putint(int __x){
		static int __a[40],__i,__j;
		static bool __neg;
		__neg=__x<0;
		if(__neg)__x=-__x;
		__i=0;
		do{
			__a[__i++]=__x%10+48;
			__x/=10;
		}while(__x);
		if(__neg)putchar('-');
		for(__j=__i-1;__j^-1;__j--)putchar(__a[__j]);
	}
	inline void putll(long long __x){
		static int __a[40],__i,__j;
		static bool __neg;
		__neg=__x<0;
		if(__neg)__x=-__x;
		__i=0;
		do{
			__a[__i++]=__x%10+48;
			__x/=10;
		}while(__x);
		if(__neg)putchar('-');
		for(__j=__i-1;__j^-1;__j--)putchar(__a[__j]);
	}
	inline void putull(unsigned long long __x){
		static int __a[40],__i,__j;
		__i=0;
		do{
			__a[__i++]=__x%10+48;
			__x/=10;
		}while(__x);
		for(__j=__i-1;__j^-1;__j--)putchar(__a[__j]);
	}
}
using namespace mine;
map<int,int>a;
int n;
inline int MAIN(){
#define MINE
#ifdef MINE
	freopen("leader.in","r",stdin);
	freopen("leader.out","w",stdout);
#endif
	getint();
	n=getint();
	for(int i=1;i<=n;i++){
		a[getint()]++;
	}
	for(map<int,int>::iterator it=a.begin();it!=a.end();it++)
		if(it->second>(n>>1)){
			putint(it->first);
			return 0;
		}
	putchar('-');
	putchar('1');
	return 0;
}
int hzoier=MAIN();
int main(){;}