http://acm.uestc.edu.cn/#/contest/show/54

A - AC Milan VS Juventus

Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Others)
Submit Status

Kennethsnow and Hlwt both love football.

One day, Kennethsnow wants to review the match in 2003 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 a:b 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 5 turns, in each turn, 2 teams each should take a penalty shoot. If goal, the team get 1 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 5 turns the 2 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 2 integers a, b. Means the result that Hlwt said.

0≤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 1 is the actual result of the match in 2003.

The Sample 2, when it is 2:4 after 4 turns, AC Milan can score at most 1 point in the next turn. So Juventus has win when it is 2:4. So the result cannot be 2:5.

This story happened in a parallel universe. In this world where we live, kennethsnow is a fan of Real Madrid.

思路:最简单也最不容易出错的情况就是把特殊情况都枚举出来。

官方题解:

代码:

 #include <fstream>
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <vector> using namespace std; #define PI acos(-1.0)
#define EPS 1e-10
#define lll __int64
#define ll long long
#define INF 0x7fffffff int main(){
//freopen("D:\\input.in","r",stdin);
//freopen("D:\\output.out","w",stdout);
int a,b;
scanf("%d %d",&a,&b);
if(a>b){
int t=a;
a=b;
b=t;
}
if(a==b) {puts("No");return ;}
if(b<=){
if(a==&&b==) {puts("No");return ;}
if(a==&&b==) {puts("No");return ;}
if(a==&&b==) {puts("No");return ;}
if(a==&&b==) {puts("No");return ;}
else {puts("Yes");return ;}
}else{
if(b-a>) {puts("No");return ;}
else {puts("Yes");return ;}
}
return ;
}

最新文章

  1. redis启用持久化
  2. linux python升级和ipython的安装
  3. 创建缓存文件(。php)
  4. socket模块
  5. 什么是spring?
  6. C++ 我想这样用(二)
  7. shell中的内建命令, 函数和外部命令
  8. UVALive - 3401 Colored Cubes
  9. javascript第九课&quot;闭包&quot;
  10. 运营商网络採用SDN所面临的挑战(一)
  11. css3毛玻璃模糊效果
  12. 在比特币的OP_RETURN上,大家都干了些啥?
  13. python模拟大数据登陆
  14. Java性能调优zz
  15. Windows安装VNC服务端
  16. 学号 20175223 《Java程序设计》第4周学习总结
  17. BZOJ2173 整数的lqp拆分(生成函数)
  18. PRCT-1302 the OCR has an invalid ip address
  19. git命令(持续更新)
  20. git android.google 源码:Unknown SSL protocol error in connection to code.google.com:443

热门文章

  1. php让页面记住表单提交后的信息方法
  2. ESXI 5.5加载 zabbix OVF 3.2.6操作
  3. ESXI5.5设置主机的时间自动同步服务 NTP
  4. 关于json_encode()的使用注意
  5. ORACLE中index的rebuild(转)
  6. ioi2016aliens
  7. mysql sleep连接过多解决办法
  8. GD库简介和使用
  9. 任务计划程序-Windows2008定时重启
  10. CENTOS 挂载ntfs移动硬盘