HDU 1029 Ignatius and the Princess IV 【求众数】
2013-08-30 18:11
190 查看
看题目觉得还挺奇怪的,后来反应过来其实是求一堆数字的众数。。。。
最近做题真是越来越懒了。。。= = 有木有人可以监督我唉
![](http://static.blog.csdn.net/xheditor/xheditor_emot/default/wail.gif)
最近做题真是越来越懒了。。。= = 有木有人可以监督我唉
![](http://static.blog.csdn.net/xheditor/xheditor_emot/default/wail.gif)
#include <stdio.h> #include <string.h> int main(){ int n, num[50000], tem, i, j; while(scanf("%d",&n) != EOF){ memset(num, 0, sizeof(num)); for(i = 1; i <= n; i++){ scanf("%d",&tem); num[tem]++; if(num[tem] >= (n + 1) / 2) j = tem; } printf("%d\n",j); } return 0; }
相关文章推荐
- hdu 1029 Ignatius and the Princess IV(水题)
- HDU--1029--Ignatius and the Princess IV
- HDU 1029 Ignatius and the Princess IV - Problem A
- HDOJ HDU 1029 Ignatius and the Princess IV
- HDU1029 Ignatius and the Princess IV 腾讯面试题抢红包(?)(模拟)
- HDU 1029 Ignatius and the Princess IV 水题
- HDU 1029 Ignatius and the Princess IV
- HDU 1029 - Ignatius and the Princess IV
- [ACM] hdu 1029 Ignatius and the Princess IV (动归或hash)
- hdu 1029 Ignatius and the Princess IV(水题)
- HDU 1029 Ignatius and the Princess IV
- HDU 1029 Ignatius and the Princess IV
- HDU-1029-Ignatius and the Princess IV
- 杭电 HDU 1029 Ignatius and the Princess IV
- HDU 1029 Ignatius and the Princess IV
- HDU 1029 Ignatius and the Princess IV(动规水题,有个很精妙的快解法)
- HDU1029 Ignatius and the Princess IV 腾讯面试题抢红包(?)(模拟)
- HDU 1029 Ignatius and the Princess IV (思路)
- HDU1029——Ignatius and the Princess IV
- HDU 1029 Ignatius and the Princess IV --- 水题