Let the Balloon Rise HDU水题
题意
让你统计字符串最多的那个串,并输出
分析
直接用map统计,不断更新最大值即可
代码
#include<iostream>
#include<algorithm>
#include<map>
#include<string>
using namespace std;
int main(){
string s,ans;
int n;
//freopen("in.txt","r",stdin);
while(cin>>n&&n){
map<string,int> m;//映射
int maxn=0;
while(n--){
cin>>s;
m[s]++;
if(m[s]>maxn){
maxn=m[s];
ans=s;
}
}
cout<<ans<<endl;
}
return 0;
}
Let the Balloon Rise HDU水题的更多相关文章
- hdoj-1004-Let the Balloon Rise(水题)
Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Oth ...
- 动态规划之HDU水题
做水题的感觉真好系列 HDU 2084 数塔 1: 12: 1 23: 1 2 34: 1 2 3 45: 1 2 3 4 5 dp[i][j]第i行第j个数取得的最大值dp[i][j] = max( ...
- Let the Balloon Rise(水)
题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=1004 Let the Balloon Rise Time Limit: 2000/1000 MS (J ...
- Let the Balloon Rise HDU 1004
Let the Balloon Rise Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other ...
- hdu 2393:Higher Math(计算几何,水题)
Higher Math Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total ...
- HDU 5832 A water problem(某水题)
p.MsoNormal { margin: 0pt; margin-bottom: .0001pt; text-align: justify; font-family: Calibri; font-s ...
- HDU 2096 小明A+B --- 水题
HDU 2096 /* HDU 2096 小明A+B --- 水题 */ #include <cstdio> int main() { #ifdef _LOCAL freopen(&quo ...
- [HDU 2602]Bone Collector ( 0-1背包水题 )
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2602 水题啊水题 还给我WA了好多次 因为我在j<w[i]的时候状态没有下传.. #includ ...
- HDU 5578 Friendship of Frog 水题
Friendship of Frog Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.ph ...
随机推荐
- Django框架的使用教程--路由-请求-响应[四]
路由 路由可以定义在工程的目录下(看你的需求),也可以定义在各个应用中来保存应用的路由,用主路文件urls中使用include()包含各个应用的子路由的数据 路由的解析顺序 Django接收到请求后, ...
- UF清log
set rowcount 20000delete from UFSystem..ua_logset rowcount 0 truncate table ua_log_bak20111201 trunc ...
- PyQt5--TextDrag
# -*- coding:utf-8 -*- ''' Created on Sep 21, 2018 @author: SaShuangYiBing Comment: ''' import sys f ...
- <20190106>千兆 小型局域网传输速率不达标问题解决
故障描述: 三层交换机下挂了 个一层交换机, 全部交换终端包括路由器传输界面意确认全是千兆设备, 其中NAS端到 主机1 的传输速度只有100Mb, 观察主机1 的网络配置,确实连接速度是 100Mb ...
- el-table-column v-if条件渲染报错h.$scopedSlots.default is not a function
我们在实际项目中经常会遇到el-table-column条件渲染出现报错的情况 报错内容: h.$scopedSlots.default is not a function 究其原因,是因为表格是el ...
- Codeforces gym 101343 A. On The Way to Lucky Plaza【概率+逆元+精度问题】
2017 JUST Programming Contest 2.0 题目链接:http://codeforces.com/gym/101343/problem/A A. On The Way to ...
- 在eclipse中,使用spring tool suite配置spring环境
本人第一次接触spring,在经过一天的努力之后,终于成功配置了spring环境. 使用spring tool suite配置 1.打开eclipse,选择help->Eclipse marke ...
- Spring Boot属性配置文件详解
相信很多人选择Spring Boot主要是考虑到它既能兼顾Spring的强大功能,还能实现快速开发的便捷.我们在Spring Boot使用过程中,最直观的感受就是没有了原来自己整合Spring应用时繁 ...
- 怎样使用CSS3媒体查询(Media Queries)制作响应式网站
自本周开始博主将开始同大家一起研究响应式web设计,CSS3 Media Queries是入门,本周更新,博主将给大家分享media queries的一些常用的用法及注意事项. Media Queri ...
- Python基础(7)——迭代器&生成器
1.列表生成式 [i*2 for i in range(10)] [fun(i) for i in range(10)] 2.生成器 # Author Qian Chenglong #列表生成器 a= ...