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. SqlServer分区表概述(转载)

    什么是分区表 一般情况下,我们建立数据库表时,表数据都存放在一个文件里. 但是如果是分区表的话,表数据就会按照你指定的规则分放到不同的文件里,把一个大的数据文件拆分为多个小文件,还可以把这些小文件放在 ...

  2. MVC4 Filter 验证客户端访问类型(移动端、PC端)

    Filter: 1 /// <summary> /// 检测是否是手机访问 /// </summary> public class IsMobileFilter : Actio ...

  3. WebService处理大数据量数据

    在通过WebService处理大数据量数据时出现如下错误: soap fault: 运行配置文件中指定的扩展时出现异常. ---> 超过了最大请求长度. 解决方法: 因为上传的文件大于系统默认配 ...

  4. 动态的计算行高 加载数据源 有多少显示多少 tableView 包含 colloctionView 显示复杂的界面写法

    有时候,我们经常碰到这样的需求 先遵守代理 @interface PublishCollectionCell ()<UICollectionViewDataSource, UICollectio ...

  5. 解决PowerDesigner 生成Sql2005-2012 找不到sysproperties表的问题

    造成此问题的原因是由于Sql 2005 删除了系统表 sysproperties 而改用 sys.extended_properties 表所致 ,微软的目的不再去猜测网上有二种解决方式 但不符合本人 ...

  6. JFrame中setDefaultCloseOperation的参数含义

    实例1:一个空的java窗口 // JFrameDemo1.java import javax.swing.*;     //使用Swing类,必须引入Swing包 public class JFra ...

  7. HashCode

    如果一个类的对象要用做hashMap的key,那么一定要注意覆盖该类的equals和hashCode方法. equals()是基类Object的方法,用于判断对象是否有相同地址及是否为同一对象 pub ...

  8. Tiles & SiteMesh

    Tiles & SiteMesh 这两天在给公司的新项目搭框架,在配tiles框架的时候发现一个小问题:    比如开发团队一共5人,每人10个页面,如果按照简单的tiles框架配置方法,每个 ...

  9. 特征的SID表、M表、P表、Q表、X表、Y表、T表

    声明:原创作品,转载时请注明文章来自SAP师太技术博客( 博/客/园www.cnblogs.com):www.cnblogs.com/jiangzhengjun,并以超链接形式标明文章原始出处,否则将 ...

  10. A replacement solution to using Google Drive in Ubuntu

    Grive2 Get dependencies You need to get the dependency libraries along with their development (-dev ...