Let the Balloon Rise HDU 1004
Let the Balloon Rise
Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)
Total Submission(s) : 150 Accepted Submission(s) : 63
year, they decide to leave this lovely job to you. <br>
A test case with N = 0 terminates the input and this test case is not to be processed.
5 green red blue red red 3 pink orange pink 0
red pink
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int main(){
char str[1001][16];
int count[1001];
int n,i,j,index;
int cnt;
while(scanf("%d",&n),n){
index=0;
char temp[16];
memset(count,0,sizeof(count));
while(n--){
scanf("%s",temp);
for(j=0;j<index;j++){
if(strcmp(temp,str[j])==0){
count[j]++;
break;
}
}
if(j==index){
memcpy(str[index++],temp,sizeof(temp));
count[j]++;
}
}
for(i=0,cnt=0;i<index;i++)
if(count[i]>count[cnt])
cnt=i;
printf("%s\n",str[cnt]);
}
}
Let the Balloon Rise HDU 1004的更多相关文章
- Let the Balloon Rise HDU水题
题意 让你统计字符串最多的那个串,并输出 分析 直接用map统计,不断更新最大值即可 代码 #include<iostream> #include<algorithm> #in ...
- 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 ...
- hdu 1004 Let the Balloon Rise(字典树)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1004 Let the Balloon Rise Time Limit: 2000/1000 MS (J ...
- HDU 1004 Let the Balloon Rise(map的使用)
传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1004 Let the Balloon Rise Time Limit: 2000/1000 MS (J ...
- hdu 1004 Let the Balloon Rise
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 ...
- hdu 1004 Let the Balloon Rise strcmp、map、trie树
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 ...
- HDUOJ Let the Balloon Rise 1004
/* Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Ja ...
随机推荐
- Node.js Net 模块
Node.js Net 模块提供了一些用于底层的网络通信的小工具,包含了创建服务器/客户端的方法,我们可以通过以下方式引入该模块: var net = require("net") ...
- mysql substr() 函数
mysql substr() 函数 用法:substr(string string,num start,num length); string为字符串:start为起始位置:length为长度. 注意 ...
- 部署 Helm - 每天5分钟玩转 Docker 容器技术(162)
本节我们将安装和部署 Helm 客户端和 Tiller 服务器. Helm 客户端 通常,我们将 Helm 客户端安装在能够执行 kubectl 命令的节点上,只需要下面一条命令: curl http ...
- Dubbo框架应用之(四)--Dubbo基于Zookeeper实现分布式实例
上三篇文章主要是解决了概念性的补充和学习,充分结合实战来深入理解 入门实例解析 第一:provider-提供服务和相应的接口 创建DemoService接口 package com.unj.dubbo ...
- 计算机网络之域名系统DNS
域名系统DNS 域名系统DNS(Domai NameSystem)是因特网使用的命名系统,用于把便于人们使用的机器名字转换为IP地址. 许多应用层软件经常直接使用域名系统,但计算机的用户只是间接而不是 ...
- Android开发使用Java8新特性
Android 支持所有 Java 7 语言功能,以及一部分 Java 8 语言功能(具体因平台版本而异).本文介绍您可以使用的新语言功能.如何正确配置项目以使用这些功能,以及您可能遇到的任何已知问题 ...
- 剑指Offer——知识点储备-数据库基础
剑指Offer--知识点储备-数据库基础 数据库 事务 事务的四个特性(ACID): 原子性(Atomicity).一致性(Consistency).隔离性(Isolation).持久性(Dura ...
- springMVC源码分析--RequestMappingHandlerAdapter(五)
上一篇博客springMVC源码分析--HandlerAdapter(一)中我们主要介绍了一下HandlerAdapter接口相关的内容,实现类及其在DispatcherServlet中执行的顺序,接 ...
- 快速了解 Robot Operating System(ROS) 机器人操作系统
http://www.ros.org/ 关于ROS About ROS http://www.ros.org/about-ros/ 机器人操作系统(ROS)是用于编写机器人软件的灵活框架.目的在简化 ...
- Linux & Windows 计时函数
直接上代码: #if defined(_WIN32) && defined(_MSC_VER) #include <windows.h> double abtic() { ...