ZOj 2104——Let the Balloon Rise
#include <iostream>#include <string>#include <map>using namespace std;int main() { map < string, int >m; string a, k; int n, max; while (cin >> n && n) { m.clear(); while (n--) { cin >> a; m[a]++; } map < string, int >::iterator it; max = 0; for (it = m.begin(); it != m.end(); it++) { if ((*it).second > max) //遍历寻找最大的气球数
{ max = (*it).second; k = (*it).first; } } cout << k << endl; } return 0;}
ZOj 2104——Let the Balloon Rise相关推荐
- HDU.1004 Let the Balloon Rise
原题 HDU.1004 Let the Balloon Rise 分类 杂题 题意 找出一组序列中出现次数最多的字符串. 输入/输出 要求与格式 样例数的确定 最后一个样例输入字符串个数为0代表样例输 ...
- [HDU1004] Let the balloon rise - 让气球升起来
[HDU1004] Let the balloon rise - 让气球升起来 Description Contest time again! How excited it is to see bal ...
- hdu-1004 Let the Balloon Rise
题目来源:hdu-1004 Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 ...
- HDOJ 1004 Let the Balloon Rise
2019独角兽企业重金招聘Python工程师标准>>> 開源中國寫的第一篇日誌 加油 水呀水 ,不過水壓不小,暈死,一晚上就死在了這裡, 回想一下這題真的真的不難 一開始是思路問題, ...
- HDOJ_1004_Let the Balloon Rise
Font Size: ← → Problem Description Contest time again! How excited it is to see balloons floating ar ...
- HDU 1004 Let the Balloon Rise (map)
题目链接 Problem Description Contest time again! How excited it is to see balloons floating around. But ...
- 算法设计与分析之ZOJ2104- Let the Balloon Rise
问题描述 输入 输入有多组测试例. 对每个测试例,第一个数字是N(0<N<1000),表示气球的数量.接下来N行,每行是一个气球的颜色,由小写字母构成的字符串表示,长度不超过15个 ...
- hdu1004——Let the Balloon Rise
原题: Problem Description Contest time again! How excited it is to see balloons floating around. But t ...
- HDU - Let the Balloon Rise(STL)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1004 Time Limit: 2000/1000 MS (Java/Others) Memory Li ...
最新文章
- 【VS开发】【DSP开发】WinDriver简介(或介绍)
- 同时设置超时时间_刚入职的小菜鸡,设错了RPC超时,搞了个线上事故
- 汇编中ah,al,ax;es,cs,ds,ss;
- 字母异位词分组—leetcode49
- Gym - 215177C 玩游戏
- Spring LDAP 2.0.0发布
- Linux中变量#,@,0,1,2,*,$$,$?的含义
- 再学 GDI+[67]: 路径画刷(7) - 画个五角星
- python——Django(ORM连表操作)
- 交通路标识别(毕业设计)
- 一种基于HBase韵海量图片存储技术
- 火灾自动报警系统下综合布线施工要素
- 为笔记本添加固态硬盘以及之后的分区方法分享
- Robin广场舞案例实践分析之深入思考
- 跨平台应用开发进阶(十一) :uni-app 实现IOS原生APP-云打包集成极光推送(JG-JPUSH)详细教程
- easypermission坑_Android 权限管理(原生、EasyPermissions、RxPermissions)-阿里云开发者社区...
- 残差网络解决什么问题详解残差网络
- Netscreen + Squid (Transparent) + c-icap + ClamAV
- Excel中VLOOKUP函数的详细用法(灰常有用,求加精!求加精!)
- python 字典