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.
green
red
blue
red
red
3
pink
orange
pink
0
#include <iostream>
#include <string>
#include <map>
using namespace std;
int main(){
map<string,int> col;
string tmp,ans;
int n,max;
while(cin>>n,n){
col.clear();
while(n--){
cin>>tmp;
col[tmp]++;
}
max=;
map<string,int>::iterator it;
for(it=col.begin();it!=col.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应用)
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(STL初体验之map)
Problem Description Contest time again! How excited it is to see balloons floating around. But to te ...
随机推荐
- U盘变小恢复工具——亲测完美可用
大白菜U盘,装系统后,U盘损坏,格盘后8G只剩345M,用usbboot恢复到了2G容量.离8G还差很远.用U盘变小恢复工具后,完美恢复到原来大小.在此记录一下,以待下次遇到相似情况使用. 原文地址 ...
- iOS FMDB
FMDB FMDB概述 什么是FMDB * FMDB是iOS平台的SQLite数据库框架 * FMDB以OC的方式封装了SQLite的C语言API FMDB的优点 * 使用起来更加面向对象,省去了很多 ...
- c# 使用oledb 写入导出excel设置单元格为成数字格式 设置了不起作用
使用oledb 导出过程中,如果excel安装版本低于2010,无论怎么设置.导出的都是文本格式. 用代码-使用数据-分列,解决
- Pet--hdu4707
Pet Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submiss ...
- PHP中的单例模式
额,只是复习到这里,做点笔记吧. 单例模式.何谓也?我想就是唯一吧.唯一的意思大概希特勒已经说的很清楚了.就是我也说不明白--把代码贴上来了事. <?php // Single instance ...
- PHP配置xdebug
其实已经做PHP超过2年了,但是今天特别有感触,所以把过程写在这里 环境是win7+apache2.2+php5.3,因为某种原因,必须使用这个版本. 然后就死活配置不出来.apache日志如下: [ ...
- python操作redis-hash
#!/usr/bin/python #!coding: utf-8 import redis if __name__=="__main__": try: conn=redis.St ...
- MYSQL 数据类型的 3 个注意
注意 1. bit(Length) 这种数据类型中,最大长度只可以是64.就是说 bit(2) 对 bit(64) 对 bit(65) 错 bit(100) 错 注 ...
- Android网络编程之Http通信
Android中提供的HttpURLConnection和HttpClient接口可以用来开发HTTP程序.以下是本人在学习中的总结与归纳.1. HttpURLConnection接口 首先需要 ...
- 开源日志库log4cplus+VS2008使用
一.简介 log4cplus是C++编写的开源的日志系统,功能非常全面.本文介绍如何在Windows+VS2008中使用该日志库. 二.下载 可从网站[url]http://log ...