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 ...
随机推荐
- POJ 2135 最小费用最大流
题目链接 Farm Tour Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 18961 Accepted: 7326 D ...
- UltraISO安装centos7系统
1. 使用最新版UltraISO将ISO镜像刻录到U盘一定要是最新版,试用版都可以,按下图操作: 2. U盘启动电脑进入安装界面正常情况下你应该会看到下面的这个界面: 选择第一项,然后按TAB键(在评 ...
- Latex:简介及安装
http://blog.csdn.net/pipisorry/article/details/53998352 LaTex是一个排版工具,功能强大.它是一个"所想即所得"的工具,你 ...
- JAVA中的常量定义在class中还是interface中比较合理?
本文地址:http://blog.csdn.net/sushengmiyan 本文作者:苏生米沿 java中使用的常量可以集中定义在一个文件中. 有两种解决方案: 1.在Constants.java中 ...
- ngx.re.match使用示例
s='...12ab345cde...' r, e = ngx.re.match(s,'(\\d+)([a-z]+)(?<num>\\d+)(?<word>[a-z]+)') ...
- nginx时间设置解析函数
https://trac.nginx.org/nginx/browser/nginx/src/core/ngx_parse.c /* * Copyright (C) Igor Sysoev * Cop ...
- JVM性能参数调优实践,不会执行Full GC,网站无停滞
原文来自:http://bbs.csdn.net/topics/310110257 本文只做整理记录,供个人学习. 1 JVM参数调优是个很头痛的问题,设置的不好,JVM不断执行Full GC,导致整 ...
- proc文件系统探索 之 根目录下的文件[二]
包括对proc根目录下stat,uptime,swaps三个文件的解析. /proc/stat 文件包含了系统启动后的一些系统统计信息. Cat /proc/stat: cpu 77781 1077 ...
- How to code like a hacker
We are coding. Are we engineers? Are we programmers? Are we coder? No, I want to be a hacker! Many g ...
- 一张图带你看懂SpriteKit中Update Loop究竟做了神马!
1首先Scene中只有开始一点时间用来回调其中的update方法 ;] 2然后是Scene中所有动作的模拟 3接下来是上一步完成之后,给你一个机会执行一些代码 4然后是Scene模拟其中的物理世界 5 ...