結果

問題 No.69 文字を自由に並び替え
ユーザー enuo-9
提出日時 2016-09-21 11:25:14
言語 Java
(openjdk 23)
結果
AC  
実行時間 134 ms / 5,000 ms
コード長 606 bytes
コンパイル時間 3,882 ms
コンパイル使用メモリ 85,332 KB
実行使用メモリ 54,340 KB
最終ジャッジ日時 2024-12-14 06:22:59
合計ジャッジ時間 6,258 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class No069 {
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);

		String a = sc.nextLine();
		String b = sc.nextLine();

		List<String> al = new ArrayList<String>();
		List<String> bl = new ArrayList<String>();

		for(int i=0; i<a.length(); i++){
			al.add(a.substring(i, i+1));
			bl.add(b.substring(i, i+1));
		}
		Collections.sort(al);
		Collections.sort(bl);
		if(al.equals(bl)){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
	}
}
0