結果
問題 | No.69 文字を自由に並び替え |
ユーザー |
|
提出日時 | 2017-07-28 23:48:58 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 30 ms / 5,000 ms |
コード長 | 461 bytes |
コンパイル時間 | 94 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-12-14 06:42:16 |
合計ジャッジ時間 | 1,254 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 15 |
ソースコード
# -*- coding: utf-8 -*- A = input() B = input() dict_A = {} dict_B = {} for char in A: if char not in dict_A: dict_A[char] = 1 else: dict_A[char] += 1 for char in B: if char not in dict_B: dict_B[char] = 1 else: dict_B[char] += 1 is_possible = True for char in A: if (char not in dict_B) or (dict_A[char] != dict_B[char]): is_possible = False if is_possible: print('YES') else: print('NO')