题意

让你统计字符串最多的那个串,并输出

分析

直接用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水题的更多相关文章

  1. hdoj-1004-Let the Balloon Rise(水题)

    Let the Balloon Rise Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Oth ...

  2. 动态规划之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( ...

  3. Let the Balloon Rise(水)

    题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=1004 Let the Balloon Rise Time Limit: 2000/1000 MS (J ...

  4. Let the Balloon Rise HDU 1004

    Let the Balloon Rise Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K (Java/Other ...

  5. hdu 2393:Higher Math(计算几何,水题)

    Higher Math Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total ...

  6. HDU 5832 A water problem(某水题)

    p.MsoNormal { margin: 0pt; margin-bottom: .0001pt; text-align: justify; font-family: Calibri; font-s ...

  7. HDU 2096 小明A+B --- 水题

    HDU 2096 /* HDU 2096 小明A+B --- 水题 */ #include <cstdio> int main() { #ifdef _LOCAL freopen(&quo ...

  8. [HDU 2602]Bone Collector ( 0-1背包水题 )

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2602 水题啊水题 还给我WA了好多次 因为我在j<w[i]的时候状态没有下传.. #includ ...

  9. HDU 5578 Friendship of Frog 水题

    Friendship of Frog Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.ph ...

随机推荐

  1. Flutter在Windows平台下的安装配置

    目录 1. 安装 Flutter SDK2. 设置环境变量3. Flutter doctor4. 安装 Android Studio5. 启动 Android Studio, 安装 Android S ...

  2. 【PAT】B1071 小赌怡情(15 分)

    水题一道,直接贴代码 #include<cstdio> #include<string.h> int main(){ //玩家的筹码数.以及 int T,K;scanf(&qu ...

  3. Centos7系统特性之systemd

    1.centos系列的系统启动流程(内核级别的启动流程): POST(加电自检)---> Boot Sequence(BIOS)---> Boot loader (MBR)---> ...

  4. Linux防火墙基础与编写防火墙规则

    Iptables采用了表和链的分层结构,每个规则表相当于内核空间的一个容器,根据规则集的不同用途划分为默认的四个表,raw表,mangle表,nat表,filter表,每个表容器内包括不同的规则链,根 ...

  5. 4.9Python数据类型(5)列表(新版)

    前言 列表是一种python类似数组的数据结构,操作灵活,可存储多种类型的数据. 目录 1.列表的基础知识 2.列表的增删改查并操作 3.列表的其他操作 4.基本方法表 (一)列表的基础知识 1.说明 ...

  6. ccf题库中2015年12月2号消除类游戏

    题目如下: 问题描述 消除类游戏是深受大众欢迎的一种游戏,游戏在一个包含有n行m列的游戏棋盘上进行,棋盘的每一行每一列的方格上放着一个有颜色的棋子,当一行或一列上有连续三个或更多的相同颜色的棋子时,这 ...

  7. 浅谈js之闭包

    1.什么是闭包??? "官方"的解释是指一个拥有许多变量和绑定了这些变量的环境的表达式(通常是一个函数),因而这些变量也是该表达式的一部分: 红皮书是这样说的,闭包是指有权访问另一 ...

  8. Qt 编程指南 7 添加背景

    . #include "QT_Text1.h" #include <QtWidgets/QApplication> #include <QBitmap> i ...

  9. nginx的反向代理proxy_pass指令

    1. 首先什么是代理服务器?客户机发送请求时,不会直接发送到目的主机,而是先被代理服务器收到,代理服务器收到客服机的请求后,再向目的机发出,目的机就会返回数据给客户机,在返回给客户机之前,会被代理服务 ...

  10. java 日期与时间类

    1.Date类:  https://www.cnblogs.com/huangminwen/p/5994927.html 2.DateFormat和SimpleDateFormat (simple简单 ...