hdu 1029 Ignatius and the Princess IV
2015-06-01 21:15
323 查看
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1029
简单题,stl水之。。
简单题,stl水之。。
[code]#include<algorithm> #include<cstdio> #include<map> using std::map; map<int,int> rec; int main() { int n, v, res, cnt; while (~scanf("%d", &n)) { res = cnt = 0; for (int i = 0; i < n; i++) { scanf("%d", &v); rec[v]++; if (rec[v] > cnt) cnt = rec[v], res = v; } printf("%d\n", res); rec.clear(); } return 0; }
相关文章推荐
- 面试题:switch语句能否作用在byte上,能否作用在long上,能否作用在String上?
- Java容器 HashMap与HashSet的学习
- 百胜集团XX:BPM实现业务流程全过程无缝链接(案例)
- xml解析
- 用Python和Pygame写游戏-从入门到精通(4)
- 用Python和Pygame写游戏-从入门到精通(5)
- 面试题:short s1=1;s1=s1+1;有什么错?short s2=1;s2+=1;有什么错?
- Hough Transform 霍夫变换检测直线
- OpenCV中的模板匹配方法及其应用
- Ajax,jQuery事例
- JavaScript前端框架的思考
- 团队开发冲刺2.6(2015.6.1)
- Excel Sheet Column Title
- PHPStorm下XDebug配置
- 面试题:在Java中如何跳出当前的多重嵌套循环?
- 凯云水利水电工程造价管理系统 技术解析(七) 机械单价(二)
- Android AsyncTask详解
- hdu 5249 KPI 【二分查找】
- wireshark 卡死,不能运行,进度显示100%,"Loading configuration files 的解决办法
- 准备一生“挖井”还是“挑水”