結果

問題 No.69 文字を自由に並び替え
ユーザー chiho_miyakochiho_miyako
提出日時 2015-04-10 11:53:41
言語 Java21
(openjdk 21)
結果
AC  
実行時間 120 ms / 5,000 ms
コード長 554 bytes
コンパイル時間 1,975 ms
コンパイル使用メモリ 72,156 KB
実行使用メモリ 56,064 KB
最終ジャッジ日時 2023-08-20 22:48:20
合計ジャッジ時間 4,729 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
55,376 KB
testcase_01 AC 117 ms
55,832 KB
testcase_02 AC 117 ms
55,544 KB
testcase_03 AC 119 ms
55,664 KB
testcase_04 AC 120 ms
55,736 KB
testcase_05 AC 120 ms
55,640 KB
testcase_06 AC 118 ms
55,880 KB
testcase_07 AC 118 ms
55,668 KB
testcase_08 AC 119 ms
56,064 KB
testcase_09 AC 119 ms
55,704 KB
testcase_10 AC 120 ms
55,600 KB
testcase_11 AC 118 ms
55,416 KB
testcase_12 AC 116 ms
55,716 KB
testcase_13 AC 115 ms
55,772 KB
testcase_14 AC 117 ms
55,780 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner koko = new Scanner(System.in);
        String a = koko.next();
        String b = koko.next();
        char[] ah = a.toCharArray();
        char[] bh = b.toCharArray();
        Arrays.sort(ah);
        Arrays.sort(bh);
        String an = String.valueOf(ah);
        String bn = String.valueOf(bh);
        if(an.equals(bn)){
            System.out.println("YES");
        }else{
            System.out.println("NO");
        }
    }
}
0