Let the Balloon Rise
This year, they decide to leave this lovely job to you.
A test case with N = 0 terminates the input and this test case is not to be processed.
green
red
blue
red
red
3
pink
orange
pink
0
pink
#include<cstdio>
#include<cstring>
int main()
{
char s[][];
char temp[];
int a[];
int n,i,j;
while()
{
memset(a,,sizeof(a));
memset(temp,,sizeof(temp));
memset(s,,sizeof(s));
scanf("%d",&n);
if(!n) break;
for(i=; i<n; i++)
scanf("%s",s[i]);
for(i=; i<n-; i++)
{
if(a[i]<) continue;/*不这样做就会超时*/
for(j=i+; j<n; j++)
{
if(a[j]<) continue;
if(strcmp(s[i],s[j])==)
{
a[i]++;
a[j]=-;
strcpy(s[j],temp);
} }
}
int max=,maxi=;
for(i=; i<n; i++)
if(a[i]>max)
{
max=a[i];
maxi=i;
}
printf("%s\n",s[maxi]); }
}
Let the Balloon Rise的更多相关文章
- hdu 1004 Let the Balloon Rise
Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Oth ...
- Let the Balloon Rise 分类: HDU 2015-06-19 19:11 7人阅读 评论(0) 收藏
Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Oth ...
- HDU 1004 Let the Balloon Rise map
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 ...
- HD1004Let the Balloon Rise
Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others ...
- Let the Balloon Rise(map)
Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Oth ...
- akoj-1073- Let the Balloon Rise
Let the Balloon Rise Time Limit:1000MS Memory Limit:65536K Total Submit:92 Accepted:58 Description ...
- HDU 1004 Let the Balloon Rise【STL<map>】
Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Oth ...
- Let the Balloon Rise(水)
题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=1004 Let the Balloon Rise Time Limit: 2000/1000 MS (J ...
- ACM Let the Balloon Rise
Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the ...
随机推荐
- Excel加密的Sheet如何hack
Excel的加密sheet如何hack: 思路:在VBA中添加穷举法模块函数并运行 源代码: Sub PasswordBreaker() 'Breaks worksheet password prot ...
- [Effective JavaScript 笔记] 第7条:视字符串为16位的代码单元序列
Unicode编码,基础:它为世界上所有的文字系统的每个字符单位分配一个唯一的整数,该整数介于0~1114111之间,在Unicode术语中称为代码点(code point). 和其它字符编码几乎没有 ...
- Linux zabbix 配置注意事项
发现php-fpm启动之后,找不到 php-fpm.pid文件??? vi php-fpm.conf 去掉里面那个 pid = run/php-fpm.pid 前面的分号然后再启动php-fpm才能自 ...
- PHP快速抓取快递信息
<?php header("Content-type:text/html;charset=utf-8"); /** * Express.class.php 快递查询类 * @ ...
- 二级域名session 共享方案
二级域名session 共享方案 1.利用COOKIE存放session_id(); 实例: 域名一文件php代码: <?php session_start(); setcookie(&qu ...
- ubuntu搭建lamp环境
首先安装软件: sudo apt-get install apache2 sudo apt-get install php5 sudo apt-get install mysql-server sud ...
- 【云计算】开源装机自动化系统 CloudBoot OSInstall 介绍
"CloudBoot"(OSinstall) 发布了. 产品更新及特点如下: 新增虚拟化操作系统适配:支持主流操作系统:RedHat.CentOS.SUSE.Ubuntu.Wind ...
- 【SpringMVC】SpringMVC系列10之视图与视图解析器
10.视图与视图解析器 10.1.概述 请求处理方法执行完成后,最终返回一个 ModelAndView处理方法,Spring MVC 也会在内部将它们装配成一个ModelAndView 对象, ...
- Maximum Product of Word Lengths
Given a string array words, find the maximum value of length(word[i]) * length(word[j]) where the tw ...
- Two Sum I & II
Two Sum I Given an array of integers, find two numbers such that they add up to a specific target nu ...