AC Milan VS Juventus(模拟)
AC Milan VS Juventus
Time Limit: 3000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others)
Kennethsnow
and Hlwt
both love football.
One day, Kennethsnow
wants to review the match in 20032003 between AC Milan and Juventus for the Championship Cup. But before the penalty shootout. he fell asleep.
The next day, he asked Hlwt
for the result. Hlwt
said that it scored aa:bb in the penalty shootout.
Kennethsnow
had some doubt about what Hlwt
said because Hlwt
is a fan of Juventus but Kennethsnow
loves AC Milan.
So he wanted to know whether the result can be a legal result of a penalty shootout. If it can be, output Yes
, otherwise output No
.
The rule of penalty shootout is as follows:
There will be 55 turns, in each turn, 22 teams each should take a penalty shoot. If goal, the team get 11 point. After each shoot, if the winner can be confirmed(i.e: no matter what happened after this shoot, the winner will not change), the match end immediately.
If after 55 turns the 22 teams score the same point. A new turn will be added, until that one team get a point and the other not in a turn.
Before the penalty shootout begins, the chief referee will decide which team will take the shoot first, and afterwards, two teams will take shoot one after the other. Since Kennethsnow fell asleep last night, he had no idea whether AC Milan or Juventus took the first shoot.
Input
The only line contains 22 integers aa, bb. Means the result that Hlwt
said.
0≤a,b≤100≤a,b≤10
Output
Output a string Yes
or No
, means whether the result is legal.
Sample input and output
Sample Input | Sample Output |
---|---|
3 2 |
Yes |
2 5 |
No |
Hint
The Sample 11 is the actual result of the match in 20032003.
The Sample 22, when it is 22:44 after 44 turns, AC Milan can score at most 11 point in the next turn. So Juventus has win when it is 22:44. So the result cannot be 22:55.
This story happened in a parallel universe. In this world where we live, kennethsnow
is a fan of Real Madrid.
题解:两个队投球,进了得1分,当一个队必胜的时候可以不用打了;现在给出得分判断是否合理;
代码:
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
bool work(int a, int b){
if(a == b)
return false;
if(a > || b > ){
if(abs(a - b) == )
return true;
else
return false;
}
if(a == || b == ){
if(b < || a < )
return false;
else
return true;
}
if(a == || b == ){
if(a == || b == )
return false;
else
return true;
}
if(a == || b == ){
return true;
}
return true;
}
int main(){
int a, b;
while(~scanf("%d%d", &a, &b)){
if(work(a, b))
puts("Yes");
else
puts("No");
}
return ;
}
AC Milan VS Juventus(模拟)的更多相关文章
- UESTC 1034 AC Milan VS Juventus 分情况讨论
AC Milan VS Juventus Time Limit: 3000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Oth ...
- cdoj第13th校赛初赛A - AC Milan VS Juventus 【枚举】
http://acm.uestc.edu.cn/#/contest/show/54 A - AC Milan VS Juventus Time Limit: 3000/1000MS (Java/Oth ...
- noi.ac NOI挑战营模拟赛1-5
注:因为博主是个每次考试都爆零垫底的菜鸡,所以此篇博客很有可能咕咕咕 (指只贴AC代码不写题解的......如果我真的不会做的话,就不能怪我了qwqwq) Day1 T1 swap 23pts 从一个 ...
- [NOI.AC]NOI2019省选模拟赛 第二场
传送门 Solution A. 一共有\(T\)组数据 每次询问你\([l,r]\)中有多少个数能被他的所有数位整除(如果数位中含有\(0\)忽略掉) 数位dp,咕咕咕 B. 题面略 考虑一个个只有两 ...
- noi.ac 邀请赛1 By cellur925
A. array 考场:上来就想暴力,首先第一个子任务肯定没问题,怎么搞都行.然后第二个子任务用个数组记下新修的值就行了.第三个子任务用一下等差数列求和公式帮助求解,每次都重新算(因为每次改变全部元素 ...
- Daily record-September
September11. I feel much more reassured when I've been for a health check. 体检之后我感到放心多了.2. The diseas ...
- noip2016题解汇总
[uoj#260]玩具谜题 传送门 http://uoj.ac/problem/260 分析 模拟. int n,m; int dir[N]; char nam[N][L]; int a[M],s[M ...
- 字典树trie的学习与练习题
博客详解: http://www.cnblogs.com/huangxincheng/archive/2012/11/25/2788268.html http://eriol.iteye.com/bl ...
- SCAU 07校赛 10317 Fans of Footbal Teams
10317 Fans of Footbal Teams 时间限制:1000MS 内存限制:65535K 题型: 编程题 语言: 无限制 Description Two famous footba ...
随机推荐
- [RxJS] Logging a Stream with do()
To help understand your stream, you’ll almost always want to log out some the intermediate values to ...
- [RxJS] Refactoring Composable Streams in RxJS, switchMap()
Refactoring streams in RxJS is mostly moving pieces of smaller streams around. This lessons demonstr ...
- Mysql User表为空
Mysql5.6刚安装完成,未设置过密码,root账号登录提示:root@localhost mysql]# mysqlERROR 1045 (28000): Access denied for us ...
- Stm32高级定时器(三)
Stm32高级定时器(三) 1 互补输出和死区插入 1.1 死区:某个处于相对无效状态的时间或空间 本来OCX信号与OCXREF时序同相同步,OCXN信号与OCXREF时序反相同步.但为了安全考虑,以 ...
- JS高级程序设计学习笔记之数组
数组创建的方式 var str = new Array();放入数字即为设置数组长度 var str = []; 数组的length可读可写 监测数组 Array.isArray()方法确定某个值是不 ...
- VC中遍历进程并获取进程信息
代码如下: /***************************************************/ /* 函数: 遍历进程信息 /* 参数:进程名称 例如: aaa.exe /* ...
- OpenGL ES 2.0 内置变量
1. 顶点着色器中的内置变量 输出变量 gl_Position(vec4):顶点数据位置gl_PointSize(float):计算一个点的大小 2.片元着色器中的内置变量 输入变量gl_FragCo ...
- Find The Multiple
算法:深搜(水题): Given a positive integer n, write a program to find out a nonzero multiple m of n whose d ...
- CODEVS 3139 栈练习3
3139 栈练习3 时间限制: 2 s 空间限制: 128000 KB 题目等级 : 黄金 Gold 题目描述 Description 比起第一题,本题加了另外一个操作,访问栈顶元素(编号3,保 ...
- 视觉差效果 - jqyery scrollTop原理
原理是用页面的滚动高度scrollTop()来控制背景图的位置 附上源码 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transition ...