且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

HDOJ1029 Ignatius and the Princess IV【AC率最高的一题】

更新时间:2022-09-11 07:41:50

Code Render Status : Rendered By HDOJ C Code Render Version 0.01 Beta
HDOJ1029 Ignatius and the Princess IV【AC率最高的一题】
#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;
}
HDOJ1029 Ignatius and the Princess IV【AC率最高的一题】

 


本文转自ZH奶酪博客园博客,原文链接:http://www.cnblogs.com/CheeseZH/archive/2012/05/08/2489833.html,如需转载请自行联系原作者