Let the Balloon Rise

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

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 < N <= 1000) -- the total number of balloons
distributed. The next N lines contain one color each. The color of a balloon is
a string of up to 15 lower-case letters.

A test case with N = 0
terminates the input and this test case is not to be processed.

 
Output
For each case, print the color of balloon for the most
popular problem on a single line. It is guaranteed that there is a unique
solution for each test case.
 
Sample Input
5
green
red
blue
red
red
3
pink
orange
pink
0
 
Sample Output
red
pink
 
Author
WU, Jiazhi
 
Source
 
Recommend
JGShining   |   We have carefully selected several
similar problems for you:  1008 1019 1021 1013 1012

#include <string.h>
#include <iostream>
#include <algorithm>
#include <stdlib.h>
#include <stdio.h>
using namespace std;
int main()
{
int i,j,n,t;
while (cin>>n&&n)
{
char c[][];
int a[];
memset(a,,sizeof(a));
for (i=;i<n;i++)
{
cin>>c[i];
for (j=;j<i;j++)
{
if (strcmp(c[i],c[j])==)
a[i]++;
}
}
int max=,t=;
for (i=;i<n;i++)
{
if (a[i]>max)
{
max=a[i];
t=i;
}
}
cout<<c[t]<<endl; } return ;
}

HDU1004 查气球的更多相关文章

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

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

  2. 3D语音天气球(源码分享)——完结篇

    转载请注明本文出自大苞米的博客(http://blog.csdn.net/a396901990),谢谢支持! 开篇废话: 由于这篇文章是本系列最后一篇,有必要进行简单的回顾和思路整理. 这个程序是由两 ...

  3. 3D语音天气球(源码分享)——通过天气服务动态创建3D球

    转载请注明本文出自大苞米的博客(http://blog.csdn.net/a396901990),谢谢支持! 开篇废话: 这个项目准备分四部分介绍: 一:创建可旋转的"3D球":3 ...

  4. bzoj 4631: 踩气球 线段树合并

    4631: 踩气球 Time Limit: 10 Sec  Memory Limit: 256 MBSubmit: 265  Solved: 136[Submit][Status][Discuss] ...

  5. [JS] 气球放气效果

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name ...

  6. 【MFC】MFC技巧学习 当做字典来查

    MFC技巧学习 摘自:http://www.cnblogs.com/leven20061001/archive/2012/10/17/2728023.html 1."属性页的添加:创建对话框 ...

  7. 3D语音天气球(源代码分享)——通过天气服务动态创建3D球

    转载请注明本文出自大苞米的博客(http://blog.csdn.net/a396901990),谢谢支持! 开篇废话: 这个项目准备分四部分介绍: 一:创建可旋转的"3D球":3 ...

  8. Dapper逆天入门~强类型,动态类型,多映射,多返回值,增删改查+存储过程+事物案例演示

    Dapper的牛逼就不扯蛋了,答应群友做个入门Demo的,现有园友需要,那么公开分享一下: 完整Demo:http://pan.baidu.com/s/1i3TcEzj 注 意 事 项:http:// ...

  9. ASP.NET从零开始学习EF的增删改查

           ASP.NET从零开始学习EF的增删改查           最近辞职了,但是离真正的离职还有一段时间,趁着这段空档期,总想着写些东西,想来想去,也不是很明确到底想写个啥,但是闲着也是够 ...

随机推荐

  1. OracleOraDb10g_home1TNSListener无法启动

    1:“本地计算机上的OracleOraDb10g_home1TNSListener服务启动后停止.某些服务在未由其他服务或程序使用时将自动停止.” 解决办法:动态ip,服务 OracleOraDb10 ...

  2. C++ 中常见预定义宏的使用

    http://blog.csdn.net/hgl868/article/details/7058906 替代字符串: #define DOWNLOAD_IMAGE_LOG /var/log/png.l ...

  3. PHP 7.1 新特性一览

    可空类型主要用于参数类型声明和函数返回值声明.主要的两种形式如下:<?phpfunction answer(): ?int  {   return null; //ok}function ans ...

  4. omnetpp inet

    http://blog.csdn.net/midie/article/details/5086983 omnetpp inet 自带了Mingw编译环境,而不再需要Visual C编译环境了.事实上, ...

  5. MySQL存储过程解析

    1.1 创建存储过程 MySQL中,创建存储过程的基本形式如下: CREATE PROCEDURE sp_name ([proc_parameter[,...]])           [charac ...

  6. spring 标注 详解

    http://snowolf.iteye.com/blog/578452 http://snowolf.iteye.com/blog/578452  非常棒的入门读物

  7. ARP欺骗病毒,网页“篡改”,注入iframe代码!

    ---------------权威资料看这里--------------- 清华大学信息网络工程研究中心-中国教育和科研计算机网应急响应组<ARP 欺骗网页劫持攻击分析>PDF文件,直接I ...

  8. Hbase can't get locations问题

    2016-11-08 22:21:16,875 ERROR [main-SendThread(ht-lxfx-01:24002)] client.ZooKeeperSaslClient: An err ...

  9. 【整理】Angularjs 监听ng-repeat onfinishrender事件

    http://stackoverflow.com/questions/15207788/calling-a-function-when-ng-repeat-has-finished http://ww ...

  10. cf.295.C.DNA Alignment(数学推导)

    DNA Alignment time limit per test 2 seconds memory limit per test 256 megabytes input standard input ...