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 ...
随机推荐
- CF-517B-DP
http://codeforces.com/contest/1072/problem/B 给出两个数列 a,b 长度为n-1 ,询问是否能构造出一个长度为n的数列t,使得 所有的ab都满足 a[i] ...
- Spring Boot的数据访问:CrudRepository接口的使用
示例 使用CrudRepository接口访问数据 创建一个新的Maven项目,命名为crudrepositorytest.按照Maven项目的规范,在src/main/下新建一个名为resource ...
- 基本数据类型list,tuple
一. 列表 1. 列表是一个可变的数据类型 列表由[]来表示, 每一项元素使用逗号隔开. 列表什么都能装. 能装对象的对象. 列表可以装大量的数据 列表是有序的 2. 列表的索引和切片 列表和字符串一 ...
- MAC常用软件工具(随某人个人版)
1.mac命令行工具(自带升级版) https://ohmyz.sh/ 连接远程服务器地址: 直接输入 ssh -A -p 22 root@IP 如:ssh -A -p 22 root@www.bai ...
- dubbo 负载均衡
在系统中可以启动多个 provider 实例,consumer 发起远程调用时,根据指定的负载均衡算法选择一个 provider. 在本机配置多个 provider,使用不同的端口: <dubb ...
- 微信小程序开发工具
微信小程序 1● 工具下载 https://mp.weixin.qq.com/debug/wxadoc/dev/devtools/download.html 2● webchart_devto ...
- linux下查看物理CPU个数、核数、逻辑CPU个数
cat /proc/cpuinfo中的信息 processor 逻辑处理器的id.physical id 物理封装的处理器的id.core id 每个核心的id.cpu cores 位于相同物理封装的 ...
- [POJ2761]Feed the dogs
Problem 查询区间第k大,但保证区间不互相包含(可以相交) Solution 只需要对每个区间左端点进行排序,那它们的右端点必定单调递增,不然会出现区间包含的情况. 所以我们暴力对下一个区间加上 ...
- FFT模板(无讲解)
#include<bits/stdc++.h> using namespace std; ; const double pi=3.1415926535898; ],len; struct ...
- Oracle数据库备份策略:全备与增量备份
一.RMAN全备份 在数据量比较小.或者数据库服务器性能很强大的情况下,可以每天进行一次全备份. 全被策略如下 1.crontab定时任务,避开业务繁忙时段 ##################### ...