結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
56,164 KB
testcase_01 AC 118 ms
56,084 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 116 ms
55,672 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 118 ms
55,404 KB
testcase_10 AC 116 ms
55,840 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 116 ms
56,160 KB
testcase_14 AC 115 ms
53,652 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("")));

        for (int i = 0; i < A.size(); i++) {
            for (String aB : B) {
                if (A.get(i).equals(aB)) {
                    A.remove(i);
                    break;
                }
            }
        }

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