【HDOJ】1029 -> Ignatius and the Princess IV
来源:互联网 发布:极限矩阵一体机 编辑:程序博客网 时间:2024/04/30 20:41
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1029
心得:
通常可以用a[index]=k表示数字index重复的次数为k。
代码:
#include <iostream>using namespace std; const int MAX=500000;int a[MAX];int main(){int n,x,i,id;while(cin>>n){memset(a,0,sizeof(a));for(i=0;i<n;i++){cin>>x;a[x]++;if(a[x]>=(n+1)/2){id=x;}}cout<<id<<endl;}return 0;}
- 【HDOJ】1029 -> Ignatius and the Princess IV
- hdoj 1029 Ignatius and the Princess IV
- HDOJ 1029 Ignatius and the Princess IV
- HDOJ Ignatius and the Princess IV 1029
- HDOJ 1029 Ignatius and the Princess IV
- hdoj 1029 Ignatius and the Princess IV
- HDOJ 1029 Ignatius and the Princess IV
- hdoj-1029-Ignatius and the Princess IV
- hdoj 1029 Ignatius and the Princess IV
- HDOJ 1029 Ignatius and the Princess IV
- HDOJ 1029 Ignatius and the Princess IV [map]
- HDOJ 1029:Ignatius and the Princess IV 解题报告
- hdoj.1029 Ignatius and the Princess IV 20140809
- HDOJ 1029 Ignatius and the Princess IV 【math】
- hdoj 1029 Ignatius and the Princess IV 【简单】
- HDOJ 1029 Ignatius and the Princess IV (水题)
- HDOJ 1029 Ignatius and the Princess IV(易题)
- 杭电HDOJ 1029 Ignatius and the Princess IV
- 学习shader之前必须知道的东西之计算机图形学(一)渲染管线
- 【转载】ACM计算几何题目推荐
- 数据结构算法集---C++语言实现
- 拷贝构造函数
- 关于listView学习,以及相关知识点延伸
- 【HDOJ】1029 -> Ignatius and the Princess IV
- HDU 1201 18岁生日
- HDU2697+DP
- android简繁体相互转换
- HashCode和equal方法
- hdu 4666 Hyperspace 多校第七场
- intent 显式意图以及隐式意图,在Activity、Service和Broadcastreceiver应用
- 2013 HTML5中国峰会演讲:Android上的HTML5:过去,现在和将来
- webview 加载数据时编码问题