HDU 1004 Let the Balloon Rise(map应用)
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<iostream>
#include<cstdio>
#include<queue>
#include<vector>
#include<cstring>
#include<string>
#include<algorithm>
#include<map>
using namespace std; int main()
{
int n;
while(~scanf("%d",&n)&&n)
{
map<string,int>m;//声明容器
map<string,int>::iterator it;//声明迭代器
string color;
for(int i=;i<n;i++)
{
cin>>color;
m[color]++;
}
int max=;
string ans;
for(it=m.begin();it!=m.end();it++)
{
if(it->second>max)
{
max=it->second;
ans=it->first;
}
}
cout<<ans<<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的使用)
传送门: 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 ...
随机推荐
- 【CSS】【1】让DIV中的文字换行显示
<div style="white-space:normal;word-break:break-all;word-wrap:break-word;">data</ ...
- 【实战问题】【2】Ambiguous mapping found. Cannot map 'xxController.Create' bean method
正文: 启动项目时出现该报错. 原因为:在controller中url映射出现重复,@RequestMapping(value = "user/create"). 解决方案为:全局 ...
- String类——StringBuilder类的源码及内存分析(java)
相同:底层均采用字符数组value来保存字符串 区别:String类的value数组有final 修饰,指向不可改,同时private 未提供修改value数组的方法.StringBuilder类的v ...
- python-day79--知识回顾
内容回顾: 1. 可迭代对象.迭代器.生成器是什么?什么区别? 可迭代对象,含有__iter__,返回一个迭代器 迭代器,含有__iter__,__next__方法 生成器,yield,__next_ ...
- Ajax请求中的async:false/true的作用【转载】
[Ajax请求中的async:false/true的作用] 作者:https://www.cnblogs.com/mmzuo-798/p/7098979.html 前言: 昨天在做倒计时修改的时候,发 ...
- zzw原创_LIKE与regexp_like中的_及转义符
1.select table_name from user_tables where table_name like 'MENU%';查出以下表MENUMENUGGG_131MENU_132MENU ...
- .NET面试基本问题
1..NET和C#的区别? .NET:一般指的是.NET FrameWork框架,是平台,技术. C#:是一编程语言,是基本.NET平台. 2.C#的委托是什么?事件是不是委托? 委托可以把一个方法作 ...
- Oracle X$Tables
前言 最早从Yong Huang那里看到关于比较详细的X$表的介绍,后来陆续从其他Oracle专家那里得到了不少信息.在Steve Adams 的书中对X$表多有提及,而且他的站点也是个资源比较丰富的 ...
- 【转】大型Vuex项目 ,使用module后, 如何调用其他模块的 属性值和方法
Vuex 允许我们把 store 分 module(模块).每一个模块包含各自的状态.mutation.action 和 getter. 那么问题来了, 模块化+命名空间之后, 数据都是相对独立的, ...
- 微信小程序开发工具 POST net::ERR_PROXY_CONNECTION_FAILED 代理问题
几天不动代码,再运行成这样了, {errMsg: "getLocation:fail Error: tunneling socket could not…d, cause=connect E ...