問題一覧 > 通常問題

No.69 Rearrange the Characters Freely

レベル : / 実行時間制限 : 1ケース 5.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 1256
作問者 : nmnmnmnmnmnmnm
お気に入りにしたユーザー ProblemId : 35 / 自分の提出
問題文最終更新日: 2018-08-22 12:31:42
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 54 (順位表) の他の問題:

Problem Statement

You are given a string $A$ and a string $B$ of the same length.
You may freely rearrange the order of the characters in string $A$.
Determine whether string $A$ can be made identical to string $B$.

Input

A
B

String $A$ and string $B$ are strings of at least $1$ and at most $10$ characters.
The length of string $A$ and the length of string $B$ are always the same.
All characters are lowercase letters from a to z.

Output

Print YES if it is possible, and NO if it is impossible.
Do not forget the newline.

Sample

Sample 1
Input
dog
god
Output
YES

Swapping d and g in dog gives god.
Therefore, the answer is YES.

Sample 2
Input
cat
tea
Output
NO

No matter how cat is rearranged, it cannot become tea.
Therefore, the answer is NO.

Sample 3
Input
silence
license
Output
YES

Sample 4
Input
yukicoder
yukicoder
Output
YES

The strings may already match from the start.

Sample 5
Input
hurjztkyua
urjukzthua
Output
NO

Meaningless strings may also appear.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。