STL: HDU1004Let the Balloon Rise
Let the Balloon Rise
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 124433 Accepted Submission(s): 49101
and find the result.
This year, they decide to leave this lovely job to you.
letters.
A test case with N = 0 terminates the input and this test case is not to be processed.
5
green
red
blue
red
red
3
pink
orange
pink
0
red
pink
#include<iostream>
#include<string>
#include<cstdio>
#include<map>
using namespace std; int main(){
map<string,int>mp;
string color,tmp;
int n;
while(scanf("%d",&n)==1 && n){
mp.clear();
for(int i=1;i<=n;i++){
cin >> color;
mp[color]++;
}
map<string,int>::iterator it;
int ans = -1;
for(it=mp.begin();it!=mp.end();it++){
if((*it).second > ans ){
ans = (*it).second;
color = (*it).first;
}
}
printf("%s\n",color.c_str());
}
}
STL: HDU1004Let the Balloon Rise的更多相关文章
- hdu1004Let the Balloon Rise
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>】
Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Oth ...
- STL-map-A - Let the Balloon Rise
A - Let the Balloon Rise Contest time again! How excited it is to see balloons floating around. But ...
- 杭电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
Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Oth ...
- Let the Balloon Rise 分类: HDU 2015-06-19 19:11 7人阅读 评论(0) 收藏
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
Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Oth ...
- HDU1004 Let the Balloon Rise(map的简单用法)
Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others ...
- HD1004Let the Balloon Rise
Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others ...
随机推荐
- Golang入门及开发环境配置
Go语言诞生背景 计算机硬件更新频繁,主流编程语言无法发挥多核多CPU的性能 软件系统复杂度不断变高,缺乏简洁高效的编程语言 C/C++运行速度快,但编译速度慢 Go语言特点 静态类型开发语言 静态: ...
- linux-history-ps1-1
1.串行端口终端(/dev/ttySn) 串行端口终端(Serial Port Terminal)是使用计算机串行端口连接的终端设备.计算机把每个串行端口都看作是一个字符设备.有段时间这些串行端口设备 ...
- Mysql5.7.26解压版(免安装版)简单快速配置步骤,5分钟搞定(win10-64位系统)
第一次安装mysql环境的时候,总会遇到各种各样的坑,在尝试了安装版和解压版的数据库之后,感觉mysql的解压版更加的简单方便,省去好多时间做专业的事情 我这里选择的是5.7.26版本,解压版下载地址 ...
- CDOJ 1061 C - 秋实大哥与战争 STL set 迭代器
题目链接: C - 秋实大哥与战争 Time Limit:1000MS Memory Limit:65535KB 64bit IO Format:%lld & %llu Sub ...
- 2019hdu多校 Fansblog
Problem Description Farmer John keeps a website called 'FansBlog' .Everyday , there are many people ...
- xwiki安装部署
环境介绍 http://aiushtha-mybook.stor.sinaapp.com/xwiki/xwiki%E4%BB%8E%E5%85%A5%E9%97%A8%E5%88%B0%E8%BF%9 ...
- Java九种基本数据类型,以及他们的封装类
基本类型 大小(字节) 默认值 封装类 byte 1 (byte)0 Byte short 2 (short)0 Short int 4 0 Integer long 8 0L Long float ...
- Spring MVC过滤器HiddenHttpMethodFilter
浏览器form表单只支持GET与POST请求,而DELETE.PUT等method并不支持,spring3.0添加了一个过滤器,可以将这些请求转换为标准的http方法,使得支持GET.POST.PUT ...
- npm-package-lock.json
npm notice created a lockfile as package-lock.json. You should commit this file. https://docs.npmjs. ...
- LeetCode_509.斐波那契数
LeetCode-cn_509 509.斐波那契数 斐波那契数,通常用 F(n) 表示,形成的序列称为斐波那契数列.该数列由 0 和 1 开始,后面的每一项数字都是前面两项数字的和.也就是: F(0) ...