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 ...
随机推荐
- 《CSS3揭秘》上(边框,投影,渐变,条纹效果,蚂蚁行军)
最近看了<CSS3揭秘>一书,里面真的是干货满满呀,现将常用到的一些技巧归纳总结,便于日后用到查找.不得不感叹学无止境哦~ 1.边框与背景 半透明边框 .demo{ background- ...
- 简易搭建git仓库、关联远程和本地仓库方法。克隆仓库方法。同一台电脑上创建两个git ssh key方法。
一,在github上建仓库 react-js-antd-demo: 二:将远程仓库与本地仓库关联 git remote add origin git@github.com:begin256/react ...
- NGINX本地服务器解析域名
1.找到hosts文件 ,添加需要解析的域名 2.在cmd命令窗口中检测解析是否生效 3 找到本地服务器的域名配置文件:添加绑定的域名,更改访问的目录 4.添加pathinfo.隐藏index.php ...
- Java内存模型(JMM)以及 垃圾回收机制 小结
内存模型: 内存模型描述了程序中各个变量(实例域.静态域和数组元素)之间的关系,以及在实际计算机系统中将变量存储到内存和从内存中取出变量这样的底层细节,对象最终是存储在内存里面的,这点没有错,但是编译 ...
- 国内外有名的java论坛
国内: www.chinajavaworld.com-论坛人很多,高手也多,不过好像都在潜水 www.cn-java.com -也很不错,文章很好,但是就是商业性浓了点. www ...
- PyCharm添加Selenium与Appium依赖
- 初识WCF6
参考:http://blog.csdn.net/songyefei/article/details/7397296 元数据交换 通过前两篇的学习,我们了解了WCF通信的一些基本原理,我们知道,WCF服 ...
- win8 便签工具
启动或显示 Sticky Notes : Win+R--->StikyNot.exe 备份Sticky Notes 保存位置 : %AppData%\Microsoft\Sticky Notes ...
- 高级mask应用
高级mask应用 用mask做遮罩可以实现复杂的效果: 用来形成遮罩的图片: 原始图片: 如果你熟悉Photoshop,那这种效果绝对是你的菜,看代码你会秒懂...... // // RootView ...
- 导入自定义模块model
编写m2.py,脚本内容如下: #!/usr/bin/python # -*- coding: utf-8 -*- 'its a module test' __author__ = 'mm' impo ...