hdu 1004 Let the Balloon Rise 解题报告
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1004
用STL 中的 Map 写的
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <map>
using namespace std; map<string, int> ballon;
string tmp; int main()
{
int i, j, n;
while (cin >> n && n)
{
ballon.clear();
for (i = ; i < n; i++)
{
cin >> tmp;
ballon[tmp]++;
}
map<string, int>::iterator iter, poi;
int maxp = ;
for (iter = ballon.begin(); iter != ballon.end(); iter++)
{
if (maxp < iter->second)
{
maxp = iter->second;
poi = iter;
}
// cout << iter->first << " " << iter->second << endl;
}
cout << poi->first << endl;
}
return ; }
hdu 1004 Let the Balloon Rise 解题报告的更多相关文章
- hdu 1004 Let the Balloon Rise(字典树)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1004 Let the Balloon Rise Time Limit: 2000/1000 MS (J ...
- HDU 1004 Let the Balloon Rise(map的使用)
传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1004 Let the Balloon Rise Time Limit: 2000/1000 MS (J ...
- HDU 1004 Let the Balloon Rise【STL<map>】
Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Oth ...
- hdu 1004 Let the Balloon Rise
Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Oth ...
- HDU 1004 Let the Balloon Rise map
Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Oth ...
- hdu 1004 Let the Balloon Rise strcmp、map、trie树
Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Oth ...
- HDU 1004 - Let the Balloon Rise(map 用法样例)
Problem Description Contest time again! How excited it is to see balloons floating around. But to te ...
- HDU 1004 Let the Balloon Rise(map应用)
Problem Description Contest time again! How excited it is to see balloons floating around. But to te ...
- Winter-1-E Let the Balloon Rise 解题报告及测试数据
Time Limit:1000MS Memory Limit:32768KB Description Contest time again! How excited it is to see ...
随机推荐
- Visual Studio各版本下载链接
Visual Studio 2015 企业版 链接: https://pan.baidu.com/s/1NFGyIbm2RNsuwwEU-bYicQ 提取码: m961 Visual Studio 2 ...
- Bitmap 图片格式并用 C++ 读写 Bitmap
转自 Bitmap 图片格式并用 C++ 读写 Bitmap 1.Bitmap 图片格式 每部分的具体内容就不展开了.要说的有两点: (1)调色板不是必须的,可有可无,有没有调色板可以通过位图文件头的 ...
- 【js】前台调试,在浏览器调试环境下找不到js怎么办?
针对这次 整个项目单页面的情况下,所有点击出现的新页面都是追加在母页面的情况下,很多时候不像原本的情况,可以直接在浏览器的调试环境下找到想要调试的js代码 这种情况下,怎么能找到子页面的js代码,调试 ...
- iOS 改变Search Bar中Scope Button中文本的颜色和字体
- (void)initSearchbar{ self.wineSearchBar.delegate = self; [self.wineSearchBar setScopeBarButtonTitl ...
- 转:android studio入门合集
http://blog.csdn.net/column/details/zsl-androidstudio.html
- STP 根桥、根port、指定port是怎样选举的
学习CCNA过程中,对交换机的根桥.跟port以及指定port选举有些迷糊.也度娘了一番,总认为一部分人解释的不够全面精细.通过细致研究终于有了自己的理解,分享给大家,假设纰漏,欢迎指正. STP收敛 ...
- vue2.0 + vux (六)NewsList 资讯页 及 NewsDetail 资讯详情页
设置代理,避免出现跨域问题 /*设置代理,避免出现跨域问题*/ proxyTable: { '/api':{ target: 'https://www.oschina.net/action/apiv2 ...
- wince开发_摩托罗拉MC3100_打开条码设置
呵呵不多说,直接上图 1.打开控制面板 watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0 ...
- UVA - 11354Bond最小生成树,LCA寻找近期公共祖先
看懂题目意思.他的意思是求将全部的城市走一遍,危急度最小.而且给 你两个s,t后让你求在走的时候,从s到t过程中危急度最大的值,并输出它, 然后就是怎样攻克了,这个题目能够说简单,也能够说难 通过思考 ...
- python(23)- 面向对象简单介绍
面向概述 面向过程:根据业务逻辑从上到下写垒代码 面向过程的设计的核心是过程,过程即解决问题的步骤, 面向过程的设计就好比精心设计好一条流水线,考虑周全什么时候处理什么东西 优点:极大降低了程序的复杂 ...