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 (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 143275 Accepted Submission(s): 56670
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.
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
while(cin>>n,n)
{
map<string,int> mm;
map <string,int>::iterator it;
string ch;
for(int i=;i<n;i++)
{
cin>>ch;
mm[ch]++;
}
int sum=;
string str;
for(it=mm.begin();it!=mm.end();it++)
{
if(it->second>sum)
{
sum=it->second;
str=it->first;
}
}
cout<<str<<endl;
}
return ;
}
HDU 1004 Let the Balloon Rise(map的使用)的更多相关文章
- 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(map应用)
Problem Description Contest time again! How excited it is to see balloons floating around. But to te ...
- 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 ...
随机推荐
- 支持n多视频网站的下载,推荐 you-get
其实刚开始是想下载youtube视频, 网上找了下 其中之一:http://jingyan.baidu.com/article/39810a23d2deb2b637fda66c.html 访问一个在线 ...
- unistd.h文件
转载地址:http://baike.baidu.com/link?url=nEyMMFYevs4yoHgQUs2bcfd5WApHUKx0b1ervi7ulR09YhtqC4txmvL1Ce3FS8x ...
- 仿小米便签图文混排 EditText解决尾部插入文字bug
一直想实现像小米便签那样的图文混排效果,收集网上的办法无非三种: 1.自定义布局,每张图片是一个ImageView,插入图片后插入EditText,缺点是实现复杂,不能像小米便签那样同时选中图片和文字 ...
- js 捕捉回车键触发登录,并验证输入内容
js 捕捉回车键触发登录,并验证输入内容 有时候我们会遇到 web 页面中捕捉按键,触发一些效果, 比如常见的回车键触发登录,并验证输入内容,下面会介绍,截图: 一.最简单的捕捉回车键:判断按下的是不 ...
- Java面试通关要点【问题汇总篇】
基础篇 基本功: 面向对象的特征 final, finally, finalize 的区别 int 和 Integer 有什么区别 重载和重写的区别 抽象类和接口有什么区别 说说反射的用途及实现 说说 ...
- Android浮动按钮
https://www.jianshu.com/p/18cbc862ba7b https://github.com/yhaolpz/FloatWindow 这样就解决了切换 Activity 时悬浮控 ...
- Mysql rpm安装
总结下mysql rpm安装的方式,与一些错误 环境[root@host2 ~]# uname -aLinux host2 2.6.32-504.3.3.el6.x86_64 #1 SMP Wed D ...
- [翻译] SVProgressHUD
SVProgressHUD https://github.com/TransitApp/SVProgressHUD SVProgressHUD is a clean and easy-to-use H ...
- Java学习---InetAddress类的学习
基础知识 1.InetAddress类 在网络API套接字,InetAddress类和它的子类型对象使用域名DNS系统,处理主机名到主机IPv4或IPv6地址的转换.如图1-1所示. 由于InetAd ...
- docker容器修改hosts文件,重启失效问题解决
docker容器修改hosts文件 搜了一大批资料,有说需要在docker run --hosts...改:dockerfile改:有点麻烦,下面方案比较好: 参照docker吧(https://ti ...