hdu1004Let the Balloon Rise
来源:互联网 发布:mac怎么把图标放到桌面 编辑:程序博客网 时间:2024/04/27 17:05
#include <iostream>#include <cstdio>#include <cstring>#include <map>#include <algorithm>using namespace std;//2013-08-31 15:48:21Accepted10040MS372K956 BG++Achiberxint main(){ int n; string t; map<string, int> mymap; map<string, int>::iterator it; while(scanf("%d", &n) != EOF && n) { mymap.clear(); for(int i = 0; i < n; i++) { cin >> t; it = mymap.find(t); if(it != mymap.end()) { it->second ++; } else { mymap[t] = 1; // printf("%d\n", mymap[t]); } } string res; int maxv = 0; for(it = mymap.begin(); it != mymap.end(); ++it) { if(it->second > maxv) { maxv = it->second; res = it->first; } } cout << res << endl; } return 0;}/**5greenredblueredred3pinkorangepink0**/
- hdu1004Let the Balloon Rise
- hdu1004Let the Balloon Rise
- hdu1004Let the Balloon Rise
- hdu1004Let the Balloon Rise
- STL: HDU1004Let the Balloon Rise
- hdu1004Let the Balloon Rise (简箪题用字典树做)
- hdu1004Let the Balloon Rise 我的c++代码
- hdu1004Let the Balloon Rise(map容器经典例题)
- ZOJ_2104_Let the Balloon Rise
- Hdu_1004_Let the Balloon Rise
- Let the Balloon Rise
- Let the Balloon Rise
- Let the Balloon Rise
- Let the Balloon Rise
- Let the Balloon Rise
- Let the Balloon Rise
- Let the Balloon Rise
- Let the Balloon Rise
- windows压缩、备份文件
- java经典实例分析
- asp.net 母版页使用详解
- JAVA的面向对象编程高手笔记
- File中的list()方法
- hdu1004Let the Balloon Rise
- hdu 1163 Eddy's digital Roots
- js 的 .innerHTML = "……" IE9- 显示有错误解决
- Xcode把应用程序打包成ipa
- 【揭示网页挂马技术的秘密(转网络安全)】
- 汉诺塔算法
- wxpython, 向BIND的回调函数传参数
- 关键路径法举例和分析
- java面向对象编程的处理记录