Problem : 1029 ( Ignatius and the Princess IV ) Judge Status : AcceptedRunId : 5913583 Language : C Author : qq1203456195Code Render Status : Rendered By HDOJ C Code Render Version 0.01 Beta
#include<stdio.h>
#include<
string.h>
#include<stdlib.h>
int ary[
1000000];
int n;
int main()
{
int i,k,ans;
while(~scanf(
"%d",&
n))
{
memset(ary,0,
sizeof(ary));
for(i=
0;i<n;i++
)
{
scanf("%d",&
k);
ary[k]++
;
if(ary[k]>=(n-(n>>
1)))
ans=
k;
}
printf("%d\n",ans);
}
return 0;
}
转载于:https://www.cnblogs.com/CheeseZH/archive/2012/05/08/2489833.html
相关资源:数据结构—成绩单生成器
转载请注明原文地址: https://win8.8miu.com/read-1494765.html