题意翻译

题目大意

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

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

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

Translated by Khassar

题目描述

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 nn 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 nn ( 1<=n<=1001<=n<=100 ) — the number of lines in the description. Then follow nn 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
ABC
输出样例#1: 复制

ABC
输入样例#2: 复制

5
A
ABA
ABA
A
A
输出样例#2: 复制

A

思路:因为只有两队,所以只统计一个队伍的成绩即可,总分减去该队伍的成绩就是另一个队伍的成绩。

#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
int n;
int grade[];
string str,name[];
int main(){
scanf("%d",&n);
cin>>name[];grade[]++;
for(int i=;i<=n-;i++) {
cin>>str;
if(str!=name[]) name[]=str;
else grade[]++;
}
if(grade[]>n-grade[]) cout<<name[];
else cout<<name[];
}

CF43A Football的更多相关文章

  1. POJ 3071 Football

    很久以前就见过的...最基本的概率DP...除法配合位运算可以很容易的判断下一场要和谁比.    from——Dinic算法                         Football Time ...

  2. Football Foundation (FOFO) TOJ 2556

    The football foundation (FOFO) has been researching on soccer; they created a set of sensors to desc ...

  3. 17111 Football team

    时间限制:1000MS  内存限制:65535K 提交次数:0 通过次数:0 题型: 编程题   语言: C++;C Description As every one known, a footbal ...

  4. CodeForces 432B Football Kit

     Football Kit Time Limit:1000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Subm ...

  5. Football(POJ3071)

    Football Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 3469   Accepted: 1782 Descript ...

  6. 16年大连网络赛 1006 Football Games

    题目链接:http://acm.hdu.edu.cn/contests/contest_showproblem.php?cid=725&pid=1006 Football Games Time ...

  7. 三分--Football Goal(面积最大)

    B - Football Goal Time Limit:500MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Su ...

  8. HDU5873:Football Games

    题目链接: Football Games 分析: 先将分数排序,然后 设当前队编号为p,设个指针为p+1,然后p>1,每次p-=2,指针右移一位p==1,指针指向的队-=1p==0,从指针开始到 ...

  9. Codeforces Gym 100425H H - Football Bets 构造

    H - Football BetsTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/ ...

随机推荐

  1. 远程桌面授权server没有提供许可证问题解决方法

    今天远程server报如图所看到的错误,网上查找的方法 方法一:(亲測有效) mstsc /V:192.168.0.3 /admin  方法二:(因为server正在使用中,未作測试) 删除远程桌面服 ...

  2. 三星抛出万亿投资计划 布局四大科技创新领域(5G、人工智能、汽车半导体、生物技术四大新兴产业)

    三星近日抛出震惊世人的投资计划,未来三年将在全球范围新增投资180万亿韩元(约1万亿元人民币).新增员工4万名.这是韩国单一企业集团大规模的投资计划. 笔者获悉,三星万亿投资计划主要分两大部分,一是在 ...

  3. linux中udev简单的用法【转】

    本文转载自:http://blog.csdn.net/qq_29729577/article/details/50825134 udev是Linux提供的一种在用户态管理设备的一种机制,udev的详细 ...

  4. layer获取弹出frame层数据

    通常,弹出层关闭之前,需要将部分数据传入父页面.这个时候怎么办呢? 通过success获取frame层的index. 然后通过cancel事件,获取子页面数据. 拿获取高德地图坐标为例: // 显示地 ...

  5. 委托delegate,Action,Func,Predicate

    C#委托的介绍(delegate.Action.Func.predicate) 委托是一个类,它定义了方法的类型,使得可以将方法当作另一个方法的参数来进行传递.事件是一种特殊的委托. 1.委托的声明 ...

  6. 实现第三方登录(QQ、微信、微博)

    第三方登录,就是使用大家比较熟悉的比如QQ.微信.微博等第三方软件登录自己的网站,这可以免去注册账号.快速留住用户的目的,免去了相对复杂的注册流程.下边就给大家讲一下怎么使用PHP开发QQ登录的功能. ...

  7. BZOJ 1485 卡特兰数 数学

    思路: 通过打表观察 这是个卡特兰数 但是它mod的数不是质数 怎么办呢 把所有数分解质因数好了 线性筛出mindiv  顺着mindiv分解质因数 复杂度$O(nlogn)$ //By Sirius ...

  8. 使用asp.net 开发的一个东平人才网招聘程序

    本人用asp.net 工作已经一两年时间了,在单位一般是做管理系统类的开发,针对的客户大都是政府机关,所以都是内网系统,虽然有成就感,但是无法再互联网上展示.虽然技术一般,但还是希望自己做一个网站在互 ...

  9. Dalvik 堆内存管理与回收

    Dalvik虚拟机用来分配对象的堆划分为两部分,一部分叫做Active Heap,另一部分叫做Zygote Heap.下面基于管理机制来介绍为何分配为这两部分,以及堆内存的管理. 我们从Android ...

  10. MVC 入口

    1.在 Global.asax public class MvcApplication : System.Web.HttpApplication { protected void Applicatio ...