Let the Balloon Rise

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 108214 Accepted Submission(s): 42023

Problem Description
Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges' favorite time is guessing the most popular problem. When the contest is over, they will count the balloons of each color and find the result.

This year, they decide to leave this lovely job to you.

Input
Input contains multiple test cases. Each test case starts with a number N (0
#include
#include
using namespace std;

int main()
{
int n, max;
string s;
map m;
map::iterator it;
while (cin >> n && n)
{
max = 0;
m.clear();
for (int i = 0; i > s;
m[s]++;
}
for (it = m.begin(); it != m.end(); it++)
{
max = max > it->second ? max : it->second;
}
for(it=m.begin();it!=m.end();it++)
{
if(max == it->second)
{
coutfirst

HDU1004 BALLO0N的更多相关文章

  1. hdu1004

    Problem Description Contest time again! How excited it is to see balloons floating around. But to te ...

  2. HDU1004 (数组元素出现最多)

    HDU1004 思路:求数组中出现次数最多的那个元素: 遍历数组元素,找出每个元素出现的次数 Input Input contains multiple test cases. Each test c ...

  3. HDU1004之总是wa的细节问题

    #include <stdio.h> #include <string.h> int main() { ][]; int n, i, k, j, max, max_i; ){ ...

  4. HDU1004 查气球

    Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Oth ...

  5. HDU1004 Let the Balloon Rise(map的简单用法)

    Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others ...

  6. HDU1004题解分析(字符串处理)

    这道题是从上个星期开始做的,看到题时觉得似曾相似,好像做过,理了一下思路敲完代码又不对,后来发现是数组用错了,之后又重新想了数组和比较用法,昨天改了一个多小时,后来样例输出全部正确,所有情况都考虑到了 ...

  7. [HDU1004] Let the balloon rise - 让气球升起来

    Problem Description Contest time again! How excited it is to see balloons floating around. But to te ...

  8. 字符串处理-Hdu1004

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1004 题目大意:给你一个数n,要求输入n个字符串,在这n个字符串中,我们需要输出出现次数最多的字符串. ...

  9. HDU-1004.Let the ballon Rise(STL-map)

    2019-02-28-08:56:03 初次做本题是用字符串硬钢,最近校队训练时又遇到才知道用map是真的舒服.需要注意的是map的用法. clear : 清除map中的所有元素,map.clear( ...

随机推荐

  1. Excel 统计在某个区间内数值的个数

    =COUNTIF(A1:A50,"<=1.0E-5")-COUNTIF(A1:A50,"<60")

  2. android架构

    周日没事,简单总结了一下Android开发中使用到的知识,以脑图的形式呈现.  

  3. Linux之curl命令详解

    url命令是一个功能强大的网络工具,它能够通过http.ftp等方式下载文件,也能够上传文件.其实curl远不止前面所说的那些功能,大家可以通过man curl阅读手册页获取更多的信息.类似的工具还有 ...

  4. 移动web前端之meta标签

    最近这段时间忙着做web移动端,东西跟pc端还是有区别的.这个月也学到了不少东西,太多了就从头开始,先总结meta标签吧. 主要标签内容和注释如下: <meta charset="UT ...

  5. Hadoop学习笔记:MapReduce框架详解

    开始聊mapreduce,mapreduce是hadoop的计算框架,我学hadoop是从hive开始入手,再到hdfs,当我学习hdfs时候,就感觉到hdfs和mapreduce关系的紧密.这个可能 ...

  6. ajax用法流程

    这里是用javascript做的一个ajax的一个用法以及总结概括.供友友们进行参考. 1 window.onload=function() { var oBtn=document.getElemen ...

  7. js关于函数调用

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  8. (转)MySQL命令行--导入导出数据库

    MySQL命令行导出数据库:   1,进入MySQL目录下的bin文件夹:cd MySQL中到bin文件夹的目录 如我输入的命令行:cd C:\Program Files\MySQL\MySQL Se ...

  9. Maven学习(五)-- 聚合与继承

    标签(空格分隔): 学习笔记 Maven的聚合特性能够把项目的各个模块聚合在一起构建: Maven的继承特性能够帮助抽取各模块相同的依赖和插件等配置,在简化POM的同时,还能够促进各个模块配置的一致性 ...

  10. Zookeeper第一课 安装和配置

    简介: Zookeeper,是Google的Chubby一个开源的实现,是Hadoop的分布式协调服务,它包含一个简单的原语集,来实现同步.配置维护.分集群.命名的服务. zookeeper是一个由多 ...