题目描述

The Iranian ChamPions Cup (ICPC), the most prestigious football league in Iran, is reaching its end, and people are eagerly waiting for the finals, which happened to be between the two most popular Iranian teams, Persepolis and Esteghlal.
The ICPC finals consist of two matches, with each team competing as the home team in one match. The winning team is determined by aggregate score, the sum of the scores of the two matches. For example, if the scores of the two matches
are Persepolis 6–0 Esteghlal in the first match, and Esteghlal 3–1 Persepolis in the second match, then the aggregate score will be Persepolis 7–3 Esteghlal, meaning that Persepolis is the winner. If aggregates are equal, the away goals rule is used to determine the winner, in which case the winner is the team that scored the most goals in the match it played away from home. If the result is still equal, a penalty shootout is required.
Hana, an avid football fan, is trying to figure out various scenarios in which her favorite team wins the finals. To this end, she aims to write a program that gets as input the number of goals in the two matches, and decides which team is the winner if it can be derived from the aggregate scores and the away goals rule, otherwise declares that the match goes to penalty kicks. You are going to help Hana write such a program.

输入

The first line of the input contains two space-separated integers p1 and s1 , where p1 and s1 are the number of goals scored by Persepolis and Esteghlal, respectively, in the first match in which Persepolis is the home team. The second line contains two space-separated integers s2 and p2 , where s2 and p2 are the number of goals scored by Esteghlal and Persepolis, respectively, in the second match in which Esteghlal is the home team. All input integers are between 0 and 20, inclusively.

输出

In the output, print the name of the winning team, either Persepolis or Esteghlal, if the winner can be determined by the aggregate scores and the away goals rule. Otherwise, print Penalty.

样例输入

复制样例数据

3 0
2 1

样例输出

Persepolis

题目大意:

第一行输入两个整数,代表以 Persepolis 为主场时 Persepolis 与 Esteghlal的比分,假如为6:0,而第二行则是以Esteghlal为主场Esteghlal与 Persepolis的比分,假如为2:1,则可以看出最终比分 Persepolis:Esteghlal为7:2,此时 Persepolis 获胜,若两队的比分相同,则按照客场规则,客场进球多的队伍获胜,若仍相同,则需进行点球大赛,输出Penalty。

解题思路:

看懂题意后其实十分简单,进行简单的比较判断即可。

代码:

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <map>
#include <stack>
#include <queue>
#include <vector>
#include <bitset>
#include <set>
#include <utility>
#include <sstream>
#include <iomanip>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define inf 0x3f3f3f3f
#define rep(i,l,r) for(int i=l;i<=r;i++)
#define lep(i,l,r) for(int i=l;i>=r;i--)
#define ms(arr) memset(arr,0,sizeof(arr))
//priority_queue<int,vector<int> ,greater<int> >q;
const int maxn = (int)1e5 + 5;
const ll mod = 1e9+7;
int main()
{#ifndef ONLINE_JUDGEfreopen("in.txt", "r", stdin);#endif//freopen("out.txt", "w", stdout);ios::sync_with_stdio(0),cin.tie(0);int a1,b1,a2,b2;cin>>a1>>b1>>a2>>b2;int t1=a1+b2;int t2=a2+b1;if(t1>t2) cout<<"Persepolis"<<endl;else if(t1<t2) cout<<"Esteghlal"<<endl;else {if(b1<b2) cout<<"Persepolis"<<endl;else if(b1>b2) cout<<"Esteghlal"<<endl;else cout<<"Penalty"<<endl;}return 0;
}

【思维】Iranian ChamPions Cup相关推荐

  1. Iranian ChamPions Cup 水题

    题目描述 The Iranian ChamPions Cup (ICPC), the most prestigious football league in Iran, is reaching its ...

  2. 伊朗 2018 ICPC区域赛 A : Iranian ChamPions Cup

    题目描述 The Iranian ChamPions Cup (ICPC), the most prestigious football league in Iran, is reaching its ...

  3. 图像文本检测的标注工具_如何检测图像中的文本

    图像文本检测的标注工具 Images are a great way to communicate without text but oftentimes images are used/abused ...

  4. NextVR踏入足球锦标赛直播 更能身历其境

    VR技术的成熟让很多不可能都成真了!而其中在虚拟现实上最有贡献的NextVR,即将踏入足球锦标赛让观众们身历其境. 感谢部分内文提供:SBF111直播 http://www.cf.org.tw/ Ne ...

  5. Python生成本地API

    方法: 创建Django项目 打开Pycharm,右键新建项目 在该项目的左下角有一个Terminal,点击一下 输入如下命令:django-admin startproject 项目名称 如djan ...

  6. Alonso Champions celebrate punishable approach will miss the European Super Cup

    According to " Marca " message , Real Madrid ( microblogging official data ) midfielder Xa ...

  7. 【CF#931.B】World Cup (思维,模拟)

    题干: The last stage of Football World Cup is played using the play-off system. There are n teams left ...

  8. CodeForces ~ 996B ~ World Cup (思维)

    题意 圆形球场有n个门,Allen想要进去看比赛.Allen采取以下方案进入球场:开始Allen站在第一个门,如果当前门前面有人Allen会花费单位时间走到下一个门,如果没人Allen从这个门就进去了 ...

  9. CodeForces ABBYY Cup 3.0 - Finals B Shave Beaver! (思维+线段树)

    题目链接 题意:给你n个数1~n的序列,随后又q次询问,每次询问有2种操作,操作1:查询从序列中取出数值为x,x+1,...,y-1,y的数的最少需要取多少次(且每取一次只能是一个递增的子序列)    ...

最新文章

  1. Linux(ubuntu)下安装anaconda(64位)并配置jupyter notebook远程访问
  2. Docker Desktop添加对Kubernetes的支持
  3. angularjs与后台传值接收值
  4. Linux安装docker-compose 1.27.4
  5. Linux Storage入门学习
  6. linux 有名管道pipe,linux 用無名管道pipe和有名管道fifo實現線程間通信
  7. python课程设计矩阵对角线之和,为每个python numpy用不同的值填充矩阵对角线
  8. 贪心——今年暑假不AC(hdu2037)
  9. ROSE User Case View
  10. android 10闪退如何解决,安卓Activity启动在10.0下闪退
  11. pg 定时删除_定时删除网站文件
  12. 力扣-507 完美数
  13. 爬取线上小程序源码看这一篇就够了!
  14. 烦哪烦哪烦哪没有力气..
  15. 国防科大计算机学院贾焰,博士群体竞风流——记国防科大教员队伍的变化
  16. discuz上传图片html,Discuz编辑器H5上传
  17. 简单xss接收cookie平台的搭建以及xss拿cookie的一些总结
  18. Web 中的“选区”和“光标”需求实现
  19. caffe与Python接口的配置(VC2013 Windows CUDA7.5 Python2.7.12)
  20. Bootstrap轮播插件,代码步骤

热门文章

  1. 计算机检索技术与技巧的检索式为,第四章计算机检索技术和数据库检索方式.ppt...
  2. 用python编excel统计表_Python实现对excel文件列表值进行统计的方法
  3. QtCreator下使用c++标准输入cin输出cout没有阻塞等待输入
  4. BugkuCTF-MISC题linux与linux2
  5. java155apk_【原创】浅谈 Android APK定点爆破
  6. matlab里inline定义矩阵,Matlab中的inline函数_matlab中inline函数
  7. java不显示图片_Java图片显示不出来,怎么解决
  8. mysql无法启动如何备份文件_mysql 5.7 停电导致无法启动、如何备份数据,重新安装mysql...
  9. mysql俩个表之间关联语法_MySQL多表关联SQL语句调优
  10. linux 拨号网关,用LINUX做在一张软盘上的拨号网关 (转)