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 ;
}

cdoj第13th校赛初赛A - AC Milan VS Juventus 【枚举】的更多相关文章

  1. cdoj第13th校赛初赛F - Fabricate equation

    http://acm.uestc.edu.cn/#/contest/show/54 F - Fabricate equation Time Limit: 3000/1000MS (Java/Other ...

  2. cdoj第13th校赛初赛H - Hug the princess

    http://acm.uestc.edu.cn/#/contest/show/54 H - Hug the princess Time Limit: 3000/1000MS (Java/Others) ...

  3. cdoj第13th校赛初赛L - Lovely princess

    http://acm.uestc.edu.cn/#/contest/show/54 L - Lovely princess Time Limit: 3000/1000MS (Java/Others) ...

  4. UESTC 1034 AC Milan VS Juventus 分情况讨论

    AC Milan VS Juventus Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Oth ...

  5. AC Milan VS Juventus(模拟)

    AC Milan VS Juventus Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Oth ...

  6. SCNU省选校赛第二场B题题解

    今晚的校赛又告一段落啦,终于"开斋"了! AC了两题,还算是满意的,英语还是硬伤. 来看题目吧! B. Array time limit per test 2 seconds me ...

  7. 2014上半年acm总结(1)(入门+校赛)

    大一下学期才开始了acm,不得不说有一点迟,但是acm确实使我的生活充实了很多,,不至于像以前一样经常没事干=  = 上学期的颓废使我的c语言学的渣的一笔..靠考前突击才基本掌握了语法 寒假突然醒悟, ...

  8. ZJU 17th 校赛

    第一次参加校赛,和小伙伴们拿了7个气球,还是挺开心的.  简单记个流水账吧. A:判断出INF的情况后 暴力模拟即可. INF的情况有x=1 || y=1 || (x==2 && y= ...

  9. ZOJ 3955 Saddle Point 校赛 一道计数题

    ZOJ3955 题意是这样的 给定一个n*m的整数矩阵 n和m均小于1000 对这个矩阵删去任意行和列后剩余一个矩阵为M{x1,x2,,,,xm;y1,y2,,,,,yn}表示删除任意的M行N列 对于 ...

随机推荐

  1. BPM编程模型(场景)

    一直开发基于操作的业务系统,主要就是通过界面,用户提交一些数据完成任务,大多数涉及多人协作的,基本都是浏览,少数可能对其进行审批,这里的审批不是电子政务那样的多人审批任务,仅仅是对数据的一个操作而已, ...

  2. python之路之函数02

    一  函数的参数: 我们把函数的参数分为形式参数和实际参数,简称形参和实参. 形参:在定义函数时,函数名括号内定义的参数. 实参:在调用函数时,函数名括号内需要用户传入的值. 注意: 实参值(相当于变 ...

  3. 解决Sybase PowerDesigner 数据库设计中 Name 自动填充Code

    在使用 Sybase PowerDesigner 进行数据库设计时,为了理清思路,需要将name改为中文名称,但是这个软件会自动将name填 充为code,可以通过如下配置修改: 选择tools-&g ...

  4. swagger配置

    1.pom.xml <!--swagger2--> <dependency> <groupId>io.springfox</groupId> <a ...

  5. JQ-用户注册用到的图形验证码,短信验证码点击事件,切换active类

    // 点击切换图形验证码 页面加载完后执行,类似window.onload $(function () { var imgCaptcha = $(".img-captcha"); ...

  6. oracle创建表空间,表及用户

    oracle要创建表要首先创建表空间,当然默认是有表空间的.而mysql创建表时,会自动创建表空间,myisam会自动建三个文 件.MYD,.MYI,.frm.innodb呢,如果没有配置独立表空间的 ...

  7. RESTful转载,多看几遍就理解了写点自己的看法和理解

    要理解资源路由就要理解什么是RESTful.如果一个架构符合REST(即Representational State Transfer的缩写,意为表现层状态转化)原则,就称它为RESTful架构. R ...

  8. JAVA WebSocKet ( 实现简单的前后端即时通信 )

    1, 前端代码 HTML5 部分 <!DOCTYPE html> <html> <head> <meta charset="utf-8"& ...

  9. java web 读取文件,文件路劲不对的问题

    都知道,一般java项目,编译后的文件是在classes文件夹下面: 而java web项目,则是在WEB-INF/classes文件夹下面.new File(fileName)须先获取tomcat中 ...

  10. REST 服务器调试 RESTDebugger.exe 和浏览器测试

    开发一个简单的rest服务器, 增加了一些函数,比如返回系统当前时间 如何验证是否正确呢,不需要自己编写客户端调用程序了, 可以直接使用RESTDebugger.exe D:\Program File ...