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 ...
随机推荐
- Centos7系统详细的启动流程
熟悉系统启动流程对于我们学习Linux系统是非常有帮助的,虽然基础,但能帮助我们更加理解Linux系统的工作机制.以下将以CentOS发行版为例来介绍Linux系统的启动流程,因为在CentOS 5. ...
- SAP SQVI 快速浏览器
SQVI可向SQL一样连接多个表浏览数据. 1.输入T-CODE:SQVI. 2.新建一个新查询case 输入CASE 名.点击新建,在弹出的窗口中输入标题,在数据源中可选择单个表查询,或者选择表连接 ...
- oracle+st_geometry
最近因为性能的原因开始关注通过oracle和st_geometry直接操作数据库来解决实际业务问题.主要还是用到了“使用 SQL 处理 ST_Geometry”.对此,ESRI给出的帮助文档中的解释如 ...
- Laravel小项目之第4节 Laravel-通过表单实现新增及操作状态提示功能
第4节 Laravel-通过表单实现新增及操作状态提示功能 4.1 显示新增表单视图 4.2 通过模型实现新增 4.3 操作状态提示 4.1 显示新增表单视图 修改边栏的链接 \resources\v ...
- Mysql主从同步(复制)(转)
文章转自:https://www.cnblogs.com/kylinlin/p/5258719.html 目录: mysql主从同步定义 主从同步机制 配置主从同步 配置主服务器 配置从服务器 使用主 ...
- rosdep update 超时
https://blog.csdn.net/azhuty/article/details/41209957 http://www.cnblogs.com/wangyarui/p/6059688.htm ...
- <转>七种测试驱动模式
本文转载自微信公众号:中国软件测试联盟 在进行软件测试时,我们都需要一个出发点,从哪里开始分析?测试设计是基于什么?简单说,就是什么驱动测试工作的进行? 基于对软件工程.产品质量和测试的理解,归纳出以 ...
- odoo之页面跳转
击备注时,会由备注id带出他的内容 customer.requirement这是备注内容表 def sale_requirements_change(self, cr, uid, ids, requi ...
- BZOJ4816 SDOI2017 数字表格 莫比乌斯反演
传送门 做莫比乌斯反演题显著提高了我的\(\LaTeX\)水平 推式子(默认\(N \leq M\),分数下取整,会省略大部分过程) \(\begin{align*} \prod\limits_{i= ...
- JavaWeb开发中采用FreeMarker生成Excel表格
最近做了一个需求,要求导出一个采购合同的Excel表格,这个表格样式比较多.由于是合同,这个Excel表格里面有好多格式要求,比如结尾处签字那部分就有格式要求.这里介绍种采用FreeM ...