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 ...
随机推荐
- python 习题
文件内容为一个多层元组,遍历该元组,当全为数字时输出数字之和,全为字母输出字符串,有数字有字母输出False,并将该内容写入到该文件的下一行中 # 方法一: t1= ((1,2,3),("a ...
- Ubuntu16.04 同时连接无线网络和以太网端口
背景: 激光雷达VLP16通过以太网线连接电脑.在本博客所述的设置之前,一旦连接以太网线,本机(dell笔记本)的无线网络立即断开,即无法同时连接无线网络和以太网端口. 问题查找: 命令行 $ ip ...
- 算法设计与分析 1.2 不一样的fibonacci数列 (矩阵快速幂思想)
题目描述 Winder 最近在学习 fibonacci 数列的相关知识.我们都知道 fibonacci 数列的递推公式是F(n) = F(n - 1) + F(n - 2)(n >= 2 且 n ...
- bootstrap editable初始化后表单可修改数据
function loadData() { var url = "${ctx }/sys/marketing/product/page"; $('#tablepager').boo ...
- 测试常用linux命令之sed篇
一.sed命令 可以放在单独的脚本文件中执行:sed -f script1 data1 多条命令也可以用{}括起来 sed可以进行文本的替换,删除,行添加,打印等.采用 sed [address]{c ...
- Run nginx from Docker in Windows
1.首先, 使用 docker run hello-world 命令 确认 docker 在本地安装成功,若成功应如下所示(此处使用的是 Docker Toolbox 在Windows上安装Docke ...
- pymysql(一)检索、增加、更新、删除数据
(一) SELECT 检索数据 代码如下: import pymysql '''pymysql使用指南host = '127.0.0.1'回送地址,指本地机port = 3306MySQL的默认端口 ...
- Servlet开发详讲
一.Servlet简介 Servlet是sun公司提供的一门用于开发动态web资源的技术. Sun公司在其API中提供了一个servlet接口,用户若想用发一个动态web资源(即开发一个Java程序向 ...
- CNN中感受野的理解
本文摘自看完还不懂卷积神经网络“感受野”?那你来找我 作者:程序_小白链接:https://www.jianshu.com/p/9305d31962d8 一.到底什么是“感受野”(接受野Recepti ...
- 查看磁盘IO负载 - 看哪些进程在读写磁盘
原文:http://www.cnblogs.com/cloudstorage/archive/2012/11/11/2764623.html 今天晚上发现服务器io有点高,顺带看看哪些进程在读写磁盘. ...