hdoj1004(let the ballooon rsie
来源:互联网 发布:大数据分析系统翻译 编辑:程序博客网 时间:2024/04/30 11:29
#include <stdio.h>#include <stdlib.h>#include <string.h>char balloon[1001][1001];int count[1001];int flag[1001];int main(){ int n; while(scanf("%d",&n)!=EOF&&n!=0) { memset(count,0,sizeof(count)); memset(flag,0,sizeof(flag)); int a=getchar(); for(int i=1;i<=n;i++) { scanf("%s",&balloon[i]); } for(int i=1;i<=n;i++) { if(flag[i]==0) { for(int j=i+1;j<=n;j++) { if(strcmp(balloon[j],balloon[i])==0) { flag[j]=1; count[i]++; } } } } int max=0; int ans; for(int i=1;i<=n;i++) { if(max<count[i]) { max=count[i]; ans=i; } } printf("%s\n",balloon[ans]); } return 0;}
真是水啊。。。
0 0
- hdoj1004(let the ballooon rsie
- HDOJ1004:Let the Balloon Rise
- HDOJ1004.Let the Balloon Rise
- HDOJ1004 Let the Balloon Rise
- hdoj1004 Let the Balloon Rise(map)
- HDOJ1004 Let the Balloon Rise(字符串——次数统计)
- HDOJ1004
- hdoj1004
- hdoj1004
- hdoj1004
- HDOJ1004
- hdoj1004
- hdoj1004
- HDOJ1004
- HDOJ1004
- HDOJ1004
- Let the Balloon Rise
- Let the Balloon Rise
- 结构体例题汇总
- 2009年系统分析师上午试题1-2
- 微软亚洲研究院开源图数据库GraphView
- 回调
- memcached-数据结构
- hdoj1004(let the ballooon rsie
- eclipse出现 Some characters cannot be mapped using "GBK" character encoding 错误代码的解决办法
- [Servlet&JSP] 标准标签
- initWithFrame和 initWithCoder
- 十进制转换二进制
- matlab 2015a找不到编译器
- 计算Fisher vector和VLAD
- ubuntu 14.04 下通过apt-get 安装jdk
- 【C#数据结构】简单选择排序