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

淄博网站建设找李光明比较靠谱的电商培训机构

淄博网站建设找李光明,比较靠谱的电商培训机构,woshop商城源码,百度开放平台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.yidumall.com/news/97752.html

相关文章:

  • 湖南响应式网站建设费用友情视频
  • 开店做网站有什么好处网站市场推广
  • 沈阳网站建设选网龙网络建站流程
  • 代理注册公司收费标准厦门百度快速优化排名
  • 怎么做系统网站搜索引擎优化关键词
  • 生猪价格今日猪价行情seo知识培训
  • 幼儿园网站设计和建设网页设计模板免费网站
  • vb实现asp网站开发整站seo怎么做
  • 喜茶品牌策划全案案例宁波seo关键词
  • 销售网站开发刷外链网站
  • 网易客服在线咨询关键词优化一般收费价格
  • 网站开发主要框架 后端seo排名怎样
  • 智能网站建设百度6大核心部门
  • 网站建设迅雷百度一下首页网页
  • 关于我校校园网站建设的调研报告今天热搜榜前十名
  • 昆明网站优化工具百度网站提交收录入口
  • 新网站建设的感想媒体发布公司
  • 微博内网站怎么做的青岛seo服务
  • 微商城网站制作舆情信息网
  • 织梦 网站栏目管理重庆网站建设公司
  • 网站开发工程师分析交换链接营销的典型案例
  • 东台做网站的广告营销策划
  • 在线做数据图的网站什么是核心关键词
  • 斗门区住房和城乡建设网站免费营销培训
  • 开发公司甲供材料管理办法外贸网站推广seo
  • 柳州城乡建设管理局网站杭州seo博客有哪些
  • 建设厅安检局网站网站推广app软件
  • 网站开发线框个人博客网站设计毕业论文
  • 网站介绍医院文化建设百度推广关键词怎么设置好
  • 品牌网站建设 杭州找资源的关键词有哪些