結果

問題 No.69 文字を自由に並び替え
ユーザー yagi2yagi2
提出日時 2017-04-25 16:32:17
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 552 bytes
コンパイル時間 2,029 ms
コンパイル使用メモリ 72,852 KB
実行使用メモリ 57,624 KB
最終ジャッジ日時 2023-09-09 21:15:50
合計ジャッジ時間 4,685 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
55,744 KB
testcase_01 AC 120 ms
55,676 KB
testcase_02 AC 117 ms
55,940 KB
testcase_03 AC 119 ms
55,584 KB
testcase_04 WA -
testcase_05 AC 115 ms
55,732 KB
testcase_06 AC 114 ms
55,628 KB
testcase_07 AC 115 ms
57,624 KB
testcase_08 AC 114 ms
55,948 KB
testcase_09 AC 114 ms
55,604 KB
testcase_10 AC 115 ms
55,936 KB
testcase_11 AC 114 ms
55,672 KB
testcase_12 AC 115 ms
56,512 KB
testcase_13 AC 115 ms
56,232 KB
testcase_14 AC 115 ms
55,916 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        List<String> A = new ArrayList<>(Arrays.asList(sc.next().split("")));
        List<String> B = new ArrayList<>(Arrays.asList(sc.next().split("")));

        List<String> oA = new ArrayList<>(A);

        A.removeAll(B);
        B.removeAll(oA);

        System.out.println((A.size() == 0 && B.size() == 0)? "YES" : "NO");
    }
}
0