Hdu 1004 Let the Balloon Rise map解决方法
来源:互联网 发布:23种设计模式 java 编辑:程序博客网 时间:2024/06/04 23:54
原题地址http://acm.hdu.edu.cn/showproblem.php?pid=1004
#include<stdio.h>#include<map>#include<cstring>#include<string>using namespace std;map<string,int>m;int main(){ char s[1005][20]; int n; while(~scanf("%d",&n)&&n!=0) { getchar(); m.clear(); int k = 0,max = 1; char ss[20]; for(int i = 0;i<n;i++) { gets(s[i]); if(m[s[i]] == 0) { m[s[i]] = 1; k++; //printf("%d\n",m[s[i]]); } else { m[s[i]]++; if(m[s[i]] > max) { max = m[s[i]]; strcpy(ss,s[i]); } } } if(max != 1) puts(ss); else for(int j=0;j<n;j++) puts(s[j]); } return 0;}
0 0
- Hdu 1004 Let the Balloon Rise map解决方法
- HDU 1004 Let the Balloon Rise【Map】
- hdu 1004 Let the Balloon Rise map
- HDU 1004 Let the Balloon Rise(map)
- HDU 1004 Let the Balloon Rise map
- hdu 1004 Let the Balloon Rise map的应用
- 【map热手题】HDU 1004—Let the Balloon Rise
- HDU 1004 Let the Balloon Rise Map的应用
- HDU-1004 Let the Balloon Rise(STL: map)
- HDU 1004 Let the Balloon Rise(Map)
- HDU-#1004 Let the Balloon Rise(字符串+map)
- map容器的应用:hdu 1004 Let the Balloon Rise
- HDU 1004 Let the Balloon Rise(STL之map)
- HDU 1004 Let the Balloon Rise (map使用)
- 【hdu 1004】Let the Balloon Rise(map)
- HDU 1004 Let the Balloon Rise (map使用)
- HDU 1004 Let the Balloon Rise(map)
- Hdu oj 1004 Let the Balloon Rise(map)
- 2014-07-15 日志
- ACM模板 dijkstra,最短路径
- Android应用程序的内存分析
- Linux netstat命令详解
- codeforce 447C
- Hdu 1004 Let the Balloon Rise map解决方法
- Linux入门学习一:使用Vmware虚拟机 安装Linux
- 树状数组
- 请教C语言语法, 老外写的代码
- 1. awk, gawk命令使用
- uva6468
- 我的淘宝历程
- poj1562 Oil Deposits(深搜dfs)
- hdu 1007 Quoit Design 最近点对(分治)