传统题 1000ms 256MiB

B - typo

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

B - typo

Score : $200$ points

Problem Statement

You are given two strings $S$ and $T$. Determine whether it is possible to make $S$ and $T$ equal by doing the following operation at most once:

  • choose two adjacent characters in $S$ and swap them.

Note that it is allowed to choose not to do the operation.

Constraints

  • Each of $S$ and $T$ is a string of length between $2$ and $100$ (inclusive) consisting of lowercase English letters.
  • $S$ and $T$ have the same length.

Input

Input is given from Standard Input in the following format:

SS

TT

Output

If it is possible to make $S$ and $T$ equal by doing the operation in Problem Statement at most once, print Yes; otherwise, print No.


abc
acb
Yes

You can swap the $2$-nd and $3$-rd characters of $S$ to make $S$ and $T$ equal.


aabb
bbaa
No

There is no way to do the operation to make $S$ and $T$ equal.


abcde
abcde
Yes

$S$ and $T$ are already equal.

2025寒假ATC码力训练营第三次练习

未参加
状态
已结束
规则
IOI
题目
6
开始于
2025-1-20 13:00
结束于
2025-1-20 14:30
持续时间
1.5 小时
主持人
参赛人数
6