103012: [Atcoder]ABC301 C - AtCoder Cards
Description
Score : $300$ points
Problem Statement
A single-player card game is popular in AtCoder Inc.
Each card in the game has a lowercase English letter or the symbol @
written on it. There is plenty number of cards for each kind.
The game goes as follows.
- Arrange the same number of cards in two rows.
- Replace each card with
@
with one of the following cards:a
,t
,c
,o
,d
,e
,r
. - If the two rows of cards coincide, you win. Otherwise, you lose.
To win this game, you will do the following cheat.
- Freely rearrange the cards within a row whenever you want after step 1.
You are given two strings $S$ and $T$, representing the two rows you have after step 1. Determine whether it is possible to win with cheating allowed.
Constraints
- $S$ and $T$ consist of lowercase English letters and
@
. - The lengths of $S$ and $T$ are equal and between $1$ and $2\times 10^5$, inclusive.
Input
The input is given from Standard Input in the following format:
$S$ $T$
Output
If it is possible to win with cheating allowed, print Yes
; otherwise, print No
.
Sample Input 1
ch@ku@ai choku@@i
Sample Output 1
Yes
You can replace the @
s so that both rows become chokudai
.
Sample Input 2
ch@kud@i akidu@ho
Sample Output 2
Yes
You can cheat and replace the @
s so that both rows become chokudai
.
Sample Input 3
aoki @ok@
Sample Output 3
No
You cannot win even with cheating.
Sample Input 4
aa bb
Sample Output 4
No
Input
题意翻译
给你两个长度相同的字符串 $S$ 和 $T$,你可以进行如下两个操作: 1. 将其中的 `@` 转化为 `a`,`t`,`c`,`o`,`d`,`e`,`r` 中的任意一个 2. 任意交换字符的顺序 问是否能通过数次以上两种操作使得字符串 $S$ 等于字符串 $T$。Output
问题描述
在AtCoder Inc.流行着一款单人纸牌游戏。
游戏中的每一张牌上都写有一个小写的英文字母或符号@
。每种牌都有很多张。
游戏的进行方式如下。
- 将同样数量的牌排列成两行。
- 将每一张写有
@
的牌替换成以下字母之一:a
、t
、c
、o
、d
、e
、r
。 - 如果两行牌完全相同,你就赢了。否则,你就输了。
为了赢得这款游戏,你将采取以下作弊方式。
- 在第1步之后的任意时刻,可以自由地重新排列一行中的牌。
你得到了两个字符串$S$和$T$,分别表示你在第1步之后的两行牌。请确定在允许作弊的情况下是否可以赢得游戏。
约束
- $S$和$T$由小写的英文字母和
@
组成。 - $S$和$T$的长度相等,且在$1$到$2\times 10^5$之间(包括$1$和$2\times 10^5$)。
输入
输入通过标准输入给出以下格式:
$S$ $T$
输出
如果在允许作弊的情况下可以赢得游戏,打印Yes
;否则,打印No
。
样例输入1
ch@ku@ai choku@@i
样例输出1
Yes
你可以将@
替换成字母,使两行都变成chokudai
。
样例输入2
ch@kud@i akidu@ho
样例输出2
Yes
你可以作弊将@
替换成字母,使两行都变成chokudai
。
样例输入3
aoki @ok@