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 ...
随机推荐
- Struts2中<jsp:forward page="xxx.action"></jsp:forward>失效
问题:在Struts2中<jsp:forward page="xxx.action"></jsp:forward>失效了,不但调转不过去还报404错误.不知 ...
- struts2中Double类型的转换
今天做项目,ssh + Extjs,页面js中定义了几个NumberField,对应的value都是double类型的,其中有个NumberField的name为 name,结果执行的时候报错了,说找 ...
- sql 表连接 join
inner join 和 join 的 区别 inner join 是内连接 ,查询出两边 都有的数据 join 是交叉 连接, 假设集合A={a, b},集合B={0, 1, 2},则两个集 ...
- LoadRunner11下载以及详细破解说明【最新】
Loadrunner11破解所需两个dll文件以及自动删除注册表工具,使用方法见附件readme.也可安装网上的办法,手动删除注册表项. 下载破解文件lm70.dll和mlr5lprg.dll lm7 ...
- java concurrency in practice读书笔记---ThreadLocal原理
ThreadLocal这个类很强大,用处十分广泛,可以解决多线程之间共享变量问题,那么ThreadLocal的原理是什么样呢?源代码最能说明问题! public class ThreadLocal&l ...
- 161102、MyBatis中批量插入
方法一: <insert id="insertbatch" parameterType="java.util.List"> <selectKe ...
- 安装SQL Server 2005
在安装SQL Server 2005时,经常会遇到一些错误,从而使系统无法正常安装.下面讲解在安装过程中经常出现的一些错误及其解决的方法.1.解决在安装SQL Server 2005时安装程序被挂起的 ...
- Spring+Mybatis整合报错Mapped Statements collection does not contain value原因之一
报错如下: ### Error updating database. Cause: java.lang.IllegalArgumentException: Mapped Statements coll ...
- zjtd 2016面试
1.写一个函数get_next() class A{ public :int next(); //取下一个值,并且指针后移 bool has_next(); private: //可以认为是一个q ...
- PHP给图片加文字(水印)
准备工作: 代码: <?php header("Content-type: image/jpeg"); //浏览器输出,如不需要可去掉此行 $im = @imagecreat ...