結果

問題 No.69 文字を自由に並び替え
ユーザー lrf141
提出日時 2016-12-04 18:07:10
言語 Java
(openjdk 23)
結果
AC  
実行時間 172 ms / 5,000 ms
コード長 591 bytes
コンパイル時間 3,635 ms
コンパイル使用メモリ 75,496 KB
実行使用メモリ 54,272 KB
最終ジャッジ日時 2024-12-14 06:26:19
合計ジャッジ時間 6,425 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.Arrays;
public class no69{
    public static void main(String... args){
        
        Scanner scan = new Scanner(System.in);
        String a = scan.next();
        String b = scan.next();
        
        String a1[] = a.split("");
        String b1[] = b.split("");
        
        Arrays.sort(a1);
        Arrays.sort(b1);
        int res = 0;
        for(int i = 0; i < a.length(); i++){
            if(a1[i].equals(b1[i])){
                res++;
            }
        }

        System.out.println((res == a.length())?"YES":"NO");
    }
}
0