結果

問題 No.69 文字を自由に並び替え
ユーザー syusyu
提出日時 2020-08-26 18:39:02
言語 Java21
(openjdk 21)
結果
AC  
実行時間 115 ms / 5,000 ms
コード長 604 bytes
コンパイル時間 1,799 ms
コンパイル使用メモリ 74,700 KB
実行使用メモリ 41,440 KB
最終ジャッジ日時 2024-04-25 03:33:53
合計ジャッジ時間 4,298 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
41,392 KB
testcase_01 AC 107 ms
40,812 KB
testcase_02 AC 112 ms
41,324 KB
testcase_03 AC 114 ms
41,256 KB
testcase_04 AC 115 ms
41,184 KB
testcase_05 AC 110 ms
41,220 KB
testcase_06 AC 113 ms
41,016 KB
testcase_07 AC 98 ms
40,236 KB
testcase_08 AC 108 ms
41,212 KB
testcase_09 AC 108 ms
41,440 KB
testcase_10 AC 100 ms
40,212 KB
testcase_11 AC 99 ms
40,408 KB
testcase_12 AC 108 ms
41,400 KB
testcase_13 AC 98 ms
40,000 KB
testcase_14 AC 108 ms
41,256 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 b=sc.next();
        
        char[] array_a=a.toCharArray();
        char[] array_b=b.toCharArray();
        
        Arrays.sort(array_a);
        Arrays.sort(array_b);
        
        a=new String(array_a);
        b=new String(array_b);
        
        //System.out.println(a+" "+b);
        
        if(a.equals(b)){
            System.out.println("YES");
        }else{
            System.out.println("NO");
        }
    }
}
0