結果

問題 No.69 文字を自由に並び替え
ユーザー face4face4
提出日時 2018-04-10 00:17:56
言語 Java21
(openjdk 21)
結果
AC  
実行時間 42 ms / 5,000 ms
コード長 569 bytes
コンパイル時間 2,490 ms
コンパイル使用メモリ 71,620 KB
実行使用メモリ 49,812 KB
最終ジャッジ日時 2023-08-21 00:02:25
合計ジャッジ時間 3,893 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
49,564 KB
testcase_01 AC 40 ms
49,300 KB
testcase_02 AC 40 ms
49,184 KB
testcase_03 AC 40 ms
49,248 KB
testcase_04 AC 40 ms
49,460 KB
testcase_05 AC 40 ms
49,484 KB
testcase_06 AC 41 ms
49,408 KB
testcase_07 AC 40 ms
49,568 KB
testcase_08 AC 40 ms
49,272 KB
testcase_09 AC 42 ms
49,812 KB
testcase_10 AC 41 ms
49,372 KB
testcase_11 AC 41 ms
49,188 KB
testcase_12 AC 41 ms
49,572 KB
testcase_13 AC 40 ms
49,548 KB
testcase_14 AC 41 ms
49,264 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;

class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        char[] a = br.readLine().toCharArray();
        char[] b = br.readLine().toCharArray();
        Arrays.sort(a);
        Arrays.sort(b);

        if (Arrays.equals(a, b)) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    }
}
0