| 记录编号 |
444809 |
评测结果 |
AAAAAAAAAA |
| 题目名称 |
979.谁是卧底 |
最终得分 |
100 |
| 用户昵称 |
Regnig Etalsnart |
是否通过 |
通过 |
| 代码语言 |
C++ |
运行时间 |
0.000 s |
| 提交时间 |
2017-09-04 11:50:49 |
内存使用 |
0.00 MiB |
显示代码纯文本
#include<cstdio>
#include<cstring>
#include<map>
#define syy myson
using namespace std;
int n,m,up,i;
map<int,int>M;
int Main()
{
freopen("leader.in","r",stdin);freopen("leader.out","w",stdout);
scanf("%d%d",&n,&m);
up=(m+(m&1))>>1;
for(i=1;i<=m;i++)
{
int x;
scanf("%d",&x);
M[x]++;
if((M[x]>up)||((m&1)&&(M[x]==up)))
{
printf("%d\n",x);
return 0;
}
}
printf("-1\n");
return 0;
}
int main(){;}
int syy=Main();