HDU1004 BALLO0N
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的更多相关文章
- hdu1004
Problem Description Contest time again! How excited it is to see balloons floating around. But to te ...
- HDU1004 (数组元素出现最多)
HDU1004 思路:求数组中出现次数最多的那个元素: 遍历数组元素,找出每个元素出现的次数 Input Input contains multiple test cases. Each test c ...
- HDU1004之总是wa的细节问题
#include <stdio.h> #include <string.h> int main() { ][]; int n, i, k, j, max, max_i; ){ ...
- HDU1004 查气球
Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Oth ...
- HDU1004 Let the Balloon Rise(map的简单用法)
Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others ...
- HDU1004题解分析(字符串处理)
这道题是从上个星期开始做的,看到题时觉得似曾相似,好像做过,理了一下思路敲完代码又不对,后来发现是数组用错了,之后又重新想了数组和比较用法,昨天改了一个多小时,后来样例输出全部正确,所有情况都考虑到了 ...
- [HDU1004] Let the balloon rise - 让气球升起来
Problem Description Contest time again! How excited it is to see balloons floating around. But to te ...
- 字符串处理-Hdu1004
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1004 题目大意:给你一个数n,要求输入n个字符串,在这n个字符串中,我们需要输出出现次数最多的字符串. ...
- HDU-1004.Let the ballon Rise(STL-map)
2019-02-28-08:56:03 初次做本题是用字符串硬钢,最近校队训练时又遇到才知道用map是真的舒服.需要注意的是map的用法. clear : 清除map中的所有元素,map.clear( ...
随机推荐
- Linux按键驱动程序设计--从简单到不简单【转】
本文转载自:http://blog.csdn.net/coding__madman/article/details/51399353 混杂设备驱动模型: 1. 混杂设备描述 在Linux系统中,存在一 ...
- 阿里云OneinStack数据库相关
阿里云OneinStack数据库相关必须进入oneinstack目录下执行相关命令 ===================================源码安装目录: Nginx:/usr/loca ...
- MVC5 + EF6 完整入门教程三
期待已久的EF终于来了. 学完本篇文章,你将会掌握基于EF数据模型的完整开发流程. 本次将会完成EF数据模型的搭建和使用. 基于这个模型,将之前的示例添加数据库查询验证功能. 文章提纲 概述 & ...
- Linux 奇技淫巧
为了整理这些命令,花了我一个晚上的时间,但是不弄明白,我就是不爽啊. 1.cmatrix 命令 黑客帝国,就是酷炫,先按F11全屏效果更佳 安装:luffy@ubuntu:~$ sudo apt-ge ...
- checkbox样式自定义
1.使用两张图片(选中和未选中),创建一个选择器. 2.使用checkbox的 drawableLeft drawableRight 等几个属性把选择器设置进去 3.checkbox的butt ...
- Mac平台上OpenCV开发环境搭建
转载于:https://segmentfault.com/a/1190000000711132 linux 编译指定库.头文件的路径问题 http://blog.csdn.net/jiaweizou/ ...
- IDispatch error #3092
在采用ADO访问ACCESS数据库的时候,出现IDispatch error #3092错误的原因之一是在SQL语句中使用了保留关键字.比如:如果表的名称为User 则会出现该错误.,若字段为valu ...
- ajax 另外两种返回类型(json xml)
返回json类型(例子): <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http ...
- php中的匿名函数和闭包(closure)
一:匿名函数 (在php5.3.0 或以上才能使用) php中的匿名函数(Anonymous functions), 也叫闭包函数(closures), 允许指定一个没有名称的函数.最常用的就是回调函 ...
- SQL语句中&、单引号等特殊符号的处理
今天遇到一个insert语句,在SQL Tools(链接Oracle数据库)插入的某列值为“Computer Hardware & Software>>CPU",这样执行 ...