当前位置: 首页 > news >正文

淄博网站建设找李光明推广接单平台

淄博网站建设找李光明,推广接单平台,it服务外包公司有哪些,移动版网站建设CF43A Football 题解题目链接字面描述题面翻译题面描述题目描述输入格式输出格式样例 #1样例输入 #1样例输出 #1样例 #2样例输入 #2样例输出 #2代码实现题目 链接 https://www.luogu.com.cn/problem/CF43A 字面描述 题面翻译 题面描述 两只足球队比赛,现给你进…

CF43A Football 题解

  • 题目
    • 链接
    • 字面描述
      • 题面翻译
        • 题面描述
      • 题目描述
      • 输入格式
      • 输出格式
      • 样例 #1
        • 样例输入 #1
        • 样例输出 #1
      • 样例 #2
        • 样例输入 #2
        • 样例输出 #2
  • 代码实现

题目

链接

https://www.luogu.com.cn/problem/CF43A

字面描述

题面翻译

题面描述

两只足球队比赛,现给你进球情况,问哪支队伍赢了。

第一行一个整数 nnn1≤n≤1001\leq n\leq 1001n100),表示有 nnn 次进球,接下来 nnn 行,每行一个长度不超过 101010,只由大写字母组成的字符串,表示一个进球的球队名,保证只有两个球队。

输出一个字符串表示胜利球队的球队名,不会平局。

题目描述

One day Vasya decided to have a look at the results of Berland 1910 Football Championship’s finals. Unfortunately he didn’t find the overall score of the match; however, he got hold of a profound description of the match’s process. On the whole there are $ n $ lines in that description each of which described one goal. Every goal was marked with the name of the team that had scored it. Help Vasya, learn the name of the team that won the finals. It is guaranteed that the match did not end in a tie.

输入格式

The first line contains an integer $ n $ ( $ 1<=n<=100 $ ) — the number of lines in the description. Then follow $ n $ lines — for each goal the names of the teams that scored it. The names are non-empty lines consisting of uppercase Latin letters whose lengths do not exceed 10 symbols. It is guaranteed that the match did not end in a tie and the description contains no more than two different teams.

输出格式

Print the name of the winning team. We remind you that in football the team that scores more goals is considered the winner.

样例 #1

样例输入 #1

1
ABC

样例输出 #1

ABC

样例 #2

样例输入 #2

5
A
ABA
ABA
A
A

样例输出 #2

A

代码实现

map的一道基础操作模板题,(稍后会写map的数据结构介绍)

#include<bits/stdc++.h>
using namespace std;int t,cnt;
string a,ans;
map<string,int>mp;
map<string,int>::iterator it;
int main(){cin>>t;while(t--){cin>>a;mp[a]++;}for(it=mp.begin();it!=mp.end();it++){if(it->second > cnt){cnt=it->second;ans=it->first;}}cout<<ans<<endl;return 0;
} 
http://www.hrbkazy.com/news/31928.html

相关文章:

  • 建筑工程网站导航站长seo综合查询
  • 可做兼职的翻译网站有哪些东莞做网页建站公司
  • 传统企业建设网站的内容西安关键词优化平台
  • 开业时网站可以做哪些活动泰州网站排名seo
  • 寻找郑州网站建设b站推广网站2024mmm
  • 深圳市专业的做网站网站如何进行seo
  • 消息提示怎么做网站注册网站免费注册
  • 苏州小程序开发外包企业网站优化服务公司
  • 网站针对爬虫爬取做的优化百度客服人工电话
  • 宝安做网站公司乐云seo亚洲足球最新排名
  • 阿里云主机 搭建网站泰安百度推广公司
  • 可以做网络推广的网站福州百度分公司
  • 免费自己创建个人网站网络营销的特点包括
  • 做网站如何月入10万建立免费网站
  • 2017招远网站建设佛山seo代理计费
  • 免费注册网站空间网站建设情况
  • 凡科可以做淘宝客网站吗西安网站维护公司
  • 工商局官网登录seo网站建设公司
  • 玛多县网站建设公司什么叫做seo
  • 股权分配方案创业初期新手怎么入行seo
  • 网站建设行业咨讯文章排名轻松seo 网站推广
  • 儋州网站建设制作百度大数据中心
  • 福州营销型网站建设百度seo排名优化助手
  • 做推广用那个网站吗百度一下电脑版首页
  • 网站怎么做访客收藏链接做网站企业
  • wordpress 滑块河北网站优化公司
  • 网站开发与维护 专业站长工具seo综合查询访问
  • 大连品牌官网建站优化推广网站排名
  • 免费b站推广网站复制码百度竞价开户联系方式
  • 做网站视频下载网络营销的特点是什么?