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 ...
随机推荐
- PhoneGap 和 PhoneGap Build 是什么?
PhoneGap是目前唯一支持7种平台的开源移动开发框架,支持的平台包括iOS.Android.BlackBerry OS.Palm WebOS.Windows Phone 7.Symbian和Bad ...
- oracle监听服务开启
输入命令netca即可开启oracle的监听服务 弹出对话框 选择监听服务配置,单击下一步 选择增加监听,单击下一步 监听的名字,默认即可,下一步 监听链接的协议,默认TCP协议即可,下一步 监听默认 ...
- ios浅谈关于nil和 NIL区别及相关问题(转)
转自:http://blog.csdn.net/guozh/article/details/8469131 个就是将引用技术减1,所谓的引用计数就是看看有多个指针指向一块内存实体,当release一次 ...
- C# 操作 AppSettings节点
1.实例 //1.简单获取内容 string value = ConfigurationManager.AppSettings["one"] as string; Console. ...
- (三)backbone - API学习 - v0.9.2 与 v1.1.2区别
Backbone.View v0.9.2 中Backbone.View 可以导出对象的options属性, v1.1.2 中去掉该属性,通过如下代码 viewOptions = ['model', ' ...
- HBase -ROOT-和.META.表结构(region定位原理)
在HBase中,大部分的操作都是在RegionServer完成的,Client端想要插入,删除,查询数据都需要先找到相应的RegionServer.什么叫相应的RegionServer?就是管理你要操 ...
- mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in
从字面的意思上说:这个函数要被弃用,请使用 mysqlli 或者是 PDO 代替 然后就查手册发现没说,大家一定要查官方最新的手册
- Javascript个人理解
一. 生成对象的原始模式 假定我们把猫看成一个对象,它有"名字"和"颜色"两个属性. var Cat = { name : '', color : '' } 现 ...
- Java学习笔记--JDBC数据库的使用
参考 hu_shengyang的专栏 : http://blog.csdn.net/hu_shengyang/article/details/6290029 一. JDBC API中提供的常用数据库 ...
- 启动安卓模拟器报错 emulator: ERROR: x86_64 emulation currently requires hardware acceleration! CPU acceleration status:HAXM must be updated(version 1.1.1<6.0.1) 解决办法
启动安卓模拟器报错 emulator: ERROR: x86_64 emulation currently requires hardware acceleration! CPU accelerat ...