103331: [Atcoder]ABC333 B - Pentagon

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:19 Solved:0

Description

Score : $200$ points

Problem Statement

A regular pentagon $P$ is shown in the figure below.

Determine whether the length of the line segment connecting points $S_1$ and $S_2$ of $P$ equals the length of the line segment connecting points $T_1$ and $T_2$.

Constraints

  • Each of $S_1$, $S_2$, $T_1$, and $T_2$ is one of the characters A, B, C, D, and E.
  • $S_1 \neq S_2$
  • $T_1 \neq T_2$

Input

The input is given from Standard Input in the following format:

$S_1S_2$
$T_1T_2$

Output

If the length of the line segment connecting points $S_1$ and $S_2$ of $P$ equals the length of the line segment connecting points $T_1$ and $T_2$, print Yes; otherwise, print No.


Sample Input 1

AC
EC

Sample Output 1

Yes

The length of the line segment connecting point A and point C of $P$ equals the length of the line segment connecting point E and point C.


Sample Input 2

DA
EA

Sample Output 2

No

The length of the line segment connecting point D and point A of $P$ does not equal the length of the line segment connecting point E and point A.


Sample Input 3

BD
BD

Sample Output 3

Yes

Output

得分:$200$分

问题描述

如图所示,正五边形$P$。

判断$P$中连接点$S_1$和$S_2$的线段长度是否等于连接点$T_1$和$T_2$的线段长度。

约束条件

  • 每个$S_1$、$S_2$、$T_1$和$T_2$是字符ABCDE中的一个。
  • $S_1 \neq S_2$
  • $T_1 \neq T_2$

输入

输入从标准输入按以下格式给出:

$S_1S_2$
$T_1T_2$

输出

如果$P$中连接点$S_1$和$S_2$的线段长度等于连接点$T_1$和$T_2$的线段长度,打印Yes;否则,打印No


样例输入1

AC
EC

样例输出1

Yes

$P$中连接点A和点C的线段长度等于连接点E和点C的线段长度。


样例输入2

DA
EA

样例输出2

No

$P$中连接点D和点A的线段长度不等于连接点E和点A的线段长度。


样例输入3

BD
BD

样例输出3

Yes

HINT

给出两条边的顶点,判断两条边是否相等?

加入题单

算法标签: