CF958E1.Guard Duty (easy)

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

The Rebel fleet is afraid that the Empire might want to strike back again. Princess Heidi needs to know if it is possible to assign RR Rebel spaceships to guard BB bases so that every base has exactly one guardian and each spaceship has exactly one assigned base (in other words, the assignment is a perfect matching). Since she knows how reckless her pilots are, she wants to be sure that any two (straight) paths – from a base to its assigned spaceship – do not intersect in the galaxy plane (that is, in 2D), and so there is no risk of collision.

输入格式

The first line contains two space-separated integers R,B(1<=R,B<=10)R,B(1<=R,B<=10) . For 1<=i<=R1<=i<=R , the i+1i+1 -th line contains two space-separated integers xix_{i} and yiy_{i} ( xi,yi<=10000|x_{i}|,|y_{i}|<=10000 ) denoting the coordinates of the ii -th Rebel spaceship. The following BB lines have the same format, denoting the position of bases. It is guaranteed that no two points coincide and that no three points are on the same line.

输出格式

If it is possible to connect Rebel spaceships and bases so as satisfy the constraint, output Yes, otherwise output No (without quote).

输入输出样例

  • 输入#1

    3 3
    0 0
    2 0
    3 1
    -2 1
    0 3
    2 2
    

    输出#1

    Yes
    
  • 输入#2

    2 1
    1 0
    2 2
    3 1
    

    输出#2

    No
    

说明/提示

For the first example, one possible way is to connect the Rebels and bases in order.

For the second example, there is no perfect matching between Rebels and bases.

首页