题意翻译

题目大意

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

第一行一个整数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. Android 怎样实现 焦点图的 无线循环滑动的状态?

    參考网址:http://my.oschina.net/xsk/blog/119167 总体的架构:ViewPgaer 中直接嵌套  IamgeView 方案一:  重写Viewpager 这样有局限性 ...

  2. [ Javascript ] 内存泄露以及循环引用解析

    内存泄露 在javascript中,我们非常少去关注内存的管理. 我们创建变量,使用变量,浏览器关注这些底层的细节都显得非常正常. 可是当应用程序变得越来越复杂而且ajax化之后,或者用户在一个页面停 ...

  3. 再探Linux动态链接 -- 关于动态库的基础知识(Dynamic Linking on Linux Revisited)

      在近一段时间里,由于多次参与相关专业软件Linux运行环境建设,深感有必要将这些知识理一理,供往后参考. 编译时和运行时 纵观程序编译整个过程,细分可分为编译(Compiling,指的是语言到平台 ...

  4. ORACLE 按表字段值的不同统计数量

    select p.id comperitorId,p.compcorp competitorName, sum(case when c.kindname = 'ATM' then c.num else ...

  5. URL重写及ASP.NET路由、Http处理模块、程序等

    这段时间在学习ASP.NET路由.HTTP处理等内容,了解了一些,但又未完全弄懂,似是而非,不管如何,作一总结,供日后借鉴和修改. 一.IIS6和IIS7经典模式和集成模式 在IIS6及IIS7经典模 ...

  6. session理解

    Session,底层的实现就是一个Map<集合>,有些Data在Server内存中,APP要分层.Data在各个层之间肯定要以一种形态传递(泛型),之前Servlet dao.getLis ...

  7. Swift-理解值类型

    在这里,我们要讲讲值类型和写时复制.在 swift 的标准库中,所有的集合类型都使用了写时复制.我们在本篇文章中看一下写时复制如何工作的,并且如何实现它. 引用类型 使用 swift 的 Data 和 ...

  8. axis2调用webservice教训

    总结教训,axis2client调用WS接口时url不能加?wsdl,而用cxf调用时则要加上. 今天用axis2的RpcServerClient调用https的webservice接口,在设置完op ...

  9. SilverLight Q&A

    1.在学校prism,Unity框架的时候,遇到的问题“The IModuleCatalog is required and cannot be null in order to initialize ...

  10. JavaScrip——插入地图

    具体操作步骤:1.百度搜索:百度地图生成器 2.打开第一个,复制网址http://api.map.baidu.com/lbsapi/creatmap/index.html,打开3.页面显示为 4.根据 ...