結果

問題 No.69 文字を自由に並び替え
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-11-09 22:23:41
言語 Java21
(openjdk 21)
結果
AC  
実行時間 119 ms / 5,000 ms
コード長 679 bytes
コンパイル時間 2,351 ms
コンパイル使用メモリ 75,504 KB
実行使用メモリ 56,176 KB
最終ジャッジ日時 2023-08-20 23:31:27
合計ジャッジ時間 5,193 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,724 KB
testcase_01 AC 117 ms
55,860 KB
testcase_02 AC 117 ms
55,452 KB
testcase_03 AC 119 ms
53,620 KB
testcase_04 AC 119 ms
55,716 KB
testcase_05 AC 118 ms
56,176 KB
testcase_06 AC 117 ms
54,164 KB
testcase_07 AC 117 ms
55,396 KB
testcase_08 AC 116 ms
55,680 KB
testcase_09 AC 115 ms
55,880 KB
testcase_10 AC 117 ms
55,836 KB
testcase_11 AC 117 ms
55,948 KB
testcase_12 AC 119 ms
56,108 KB
testcase_13 AC 118 ms
55,840 KB
testcase_14 AC 119 ms
55,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String A = sc.next();
        String [] arr1 = A.split("");
        Arrays.sort(arr1);
        String a = "";
        for(int i=0; i<arr1.length; i++){
             a = a + arr1[i];
        }

        String B = sc.next();
        String [] arr2 = B.split("");
        Arrays.sort(arr2);
        String b = "";
        for(int i=0; i<arr2.length; i++){
             b = b + arr2[i];
        }

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


    }
}
0