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 ...
随机推荐
- Laravel中构造方法中不能写return!!!
今天遇到的大坑 在laravel中 __construct 这个方法中不能写return 完全不能返回 而且还会向下执行具体原因不知道为什么解决办法!!!!用中间件来实现就可以了 Over!!!
- springMVC源码解析--HandlerMethodArgumentResolverComposite参数解析器集合(二)
上一篇博客springMVC源码分析--HandlerMethodArgumentResolver参数解析器(一)中我们已经介绍了参数解析相关的东西,并且也提到了HandlerMethodArgume ...
- [精简版]snowing snow
CSS <style> body { background: #eee; } @keyframes mysnow { 0% { bottom: 100%; opacity: 0; } 50 ...
- 浏览器加载和渲染html的顺序(html/css/js)
最近在学习前端的技术,把html.js.css的基础知识看了看.感觉越看越觉得前端并不比后端容易,技术含量还是相当大的.今天突然想弄明白浏览器到底是怎么加载和渲染html的?html中的DOM.js文 ...
- Dynamics CRM Trigger plugin for N:N relationships
博客原文:https://demystifyingcrm.wordpress.com/2014/12/17/trigger-plugin-for-nn-relationships-in-dynamic ...
- Weblogic 12c 集群部署和session复制
在上一篇Weblogic12c集群搭建的基础上,这一篇介绍Weblogic12c集群应用的部署和session复制. 1.启动服务 首先在weblogic12c控制台,启动受托管服务server1.s ...
- Android简易实战教程--第三十七话《NotifiCation》
通知的使用,无疑是Android系统的亮点之一:就连IOS在5.0开始也引入了类似通知的技巧.可见它的实用性. 今天这个小案例,就学习一下通知的基本使用,API是使用最新的API,4.3以前创建通知的 ...
- how to output quotes in bash prompt
introduction In certain situations, quotes are required to be output in the command prompt. To do th ...
- OpenCV Python 录制视频
调用摄像头 引入库支持 初始化 调整界面大小 实时显示 录制视频并保存 fourcc问题解决 代码实现 效果展示 总结 学到实用OpenCV调用笔记本电脑的摄像头,并录制视频保存到本地硬盘的时候,出现 ...
- Java编程思想阅读收获
15年8月份买了一本Java编程思想第四版中文版.之所以买中文版是因为我试读了同事的英文版发现自己英语水平还是有限,单词虽然认识,但对很多句子把握不准,这样看书太慢了,要理解英文还要理解技术有些hol ...