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 ...
随机推荐
- PROP_ENTRY_TYPE用法
最近几天刚换了vs2019,然后各种水土不服 这不 刚建了一个ATL组件,发现添加了属性编译不过,提示: 错误 C4995 “PROP_ENTRY”: 名称被标记为 #pragma deprecate ...
- Linux培训教程 linux下修改用户权限的方法
一般我们日常碰到要修改用户权限的,往往是要么修改一下用户的gorupid,通过上面命令可以改;要么是把普通用户改成具有超级权限的用户,这个一般自己不能直接改,只能是root或有root权限的用户才能帮 ...
- HTML 和 CSS 画三角形和画多边行基本原理及实践
基本 HTML 标签 <div class = 'test'></div> 基本 CSS 代码 .test { width: 100px; height: 100px; bac ...
- 3D Computer Grapihcs Using OpenGL - 17 添加相机(旋转)
在11节我们说过,MVP矩阵中目前只应用了两个矩阵,World to View 矩阵被省略了,这就导致我们的画面没有办法转换视角. 本节我们将添加这一环节,让相机可以旋转. 为了实现这一目的,我们添加 ...
- springboot 基于@Scheduled注解 实现定时任务
前言 使用SpringBoot创建定时任务非常简单,目前主要有以下三种创建方式: 一.基于注解(@Scheduled) 二.基于接口(SchedulingConfigurer) 前者相信大家都很熟悉, ...
- Python深度学习读书笔记-4.神经网络入门
神经网络剖析 训练神经网络主要围绕以下四个方面: 层,多个层组合成网络(或模型) 输入数据和相应的目标 损失函数,即用于学习的反馈信号 优化器,决定学习过程如何进行 如图 3-1 所示:多个层 ...
- 【ASK】设置网卡启动遇到的事!
上次动笔是16年的事情了,一晃3年过去了.算了,不感慨了.直奔主题吧. 1.今天朋友要把一批win10的机器设置成网卡启动. 2.网卡是intel集成的. 3.按照主板说明已经设置成功. 4.通过wi ...
- NeDB——node嵌入式数据库
参考资料1:[http://www.alloyteam.com/2016/03/node-embedded-database-nedb/] 参考资料2:[https://github.com/loui ...
- Java面试题集(131-135)
Java程序员面试题集(131-135) 摘要:这部分内容准备重新发布为Java程序员面试题集(151-180),但这篇帖子仍然保留在这里.查看新内容请点击Java程序员面试题集(151-180) 1 ...
- ELK是什么
为什么做日志系统 通常当系统发生故障时,工程师需要登录到各个服务器上,使用 grep / sed / awk 等 Linux 脚本工具去日志里查找故障原因.在没有日志系统的情况下,首先需要定位处理请求 ...