HDU 1004 Let the Balloon Rise map
Let the Balloon Rise
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 104108 Accepted Submission(s): 40046
This year, they decide to leave this lovely job to you.
A test case with N = 0 terminates the input and this test case is not to be processed.
思路:简单map
#include <iostream>
#include <string>
#include <map>
using namespace std;
int main()
{
int n, max;
];
map<string,int> one;
map<string, int>::iterator itea;
string str;
while(cin>>n&&n)
{
while(n--)
{
cin>>str;
one[str]++;
}
,itea=one.begin();itea!=one.end();++itea)
{
if(itea->second>max)
{
max=itea->second;
str=itea->first;
}
}
cout<<str<<endl;
one.clear();
}
}
HDU 1004 Let the Balloon Rise map的更多相关文章
- 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的使用)
传送门: 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(字典树)
题目链接: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 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 解题报告
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1004 用STL 中的 Map 写的 #include <iostream> #includ ...
- 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 用法样例)
Problem Description Contest time again! How excited it is to see balloons floating around. But to te ...
- HDU 1004 Let the Balloon Rise(STL初体验之map)
Problem Description Contest time again! How excited it is to see balloons floating around. But to te ...
随机推荐
- 锋利的JQuery(三)
事件冒泡: 解决方式: 1.使用事件对象:$("element").bind("click",function(event){}); 这个事件对象只有事件处理函 ...
- Elasticsearch--配置文件
config目录下有2个配置文件:es的配置文件:elasticsearch.yml日志配置文件:logging.yml,更多内容请参考:ELK教程 cluster.name: elasticsear ...
- 解决 “invalid resource directory name”, resource “crunch”
try this: from the menu click Project->Clean... a popup window will appear. select the check ...
- 指针二次释放(_BLOCK_TYPE_IS_VALID)
[1]_BLOCK_TYPE_IS_VALID是什么错误? (1)最简单的示例代码如下: void main() { ); delete pA; delete pA; } (2)运行后崩溃截图如下: ...
- linux 安装
分区:/boot swap /这三个顺序分区 mkdir -p|-m cat >> 123.txt<<EOF 123 345 EOF 0.1和2分别表示标准输入.标准输出和标准 ...
- Oracle集合运算符 交集 并集 差集
集合运算符:UNION/UNION ALL 并集,INTERSECT 交集,MINUS 差集 一.union求并集,公共部分只有包含一次 例:求emp表ename中含’A‘或含有‘M’ SQL&g ...
- 常用的math函数
<?php //1.abs — 绝对值 echo abs(-77); //ceil — 进一法取整 ...
- 如何在ecshop订单中显示客户给商家的留言
ecshop后台->订单管理->订单打印 在你想要加入的位置加入 客户给商家的留言:{$order.postscript} ok啦,很简单咯
- ecshop的几个小瑕疵
在安装Ecshop的时候,遇到两个问题: 1.Strict Standards: Non-static method cls_image::gd_version() should not be cal ...
- shell基础二十篇 一些笔记
shell基础二十篇 转自 http://bbs.chinaunix.net/thread-452942-1-1.html 研讨:Bash 内建命令 read (read命令更具体的说明见博客收藏的一 ...