結果

問題 No.69 文字を自由に並び替え
ユーザー enuo-9enuo-9
提出日時 2016-09-21 11:25:14
言語 Java21
(openjdk 21)
結果
AC  
実行時間 119 ms / 5,000 ms
コード長 606 bytes
コンパイル時間 3,421 ms
コンパイル使用メモリ 75,264 KB
実行使用メモリ 56,396 KB
最終ジャッジ日時 2023-08-20 23:28:56
合計ジャッジ時間 6,029 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
56,396 KB
testcase_01 AC 115 ms
55,684 KB
testcase_02 AC 116 ms
56,324 KB
testcase_03 AC 116 ms
56,364 KB
testcase_04 AC 118 ms
55,956 KB
testcase_05 AC 118 ms
55,844 KB
testcase_06 AC 118 ms
55,488 KB
testcase_07 AC 118 ms
54,812 KB
testcase_08 AC 118 ms
56,296 KB
testcase_09 AC 118 ms
56,132 KB
testcase_10 AC 118 ms
55,788 KB
testcase_11 AC 119 ms
56,080 KB
testcase_12 AC 118 ms
56,024 KB
testcase_13 AC 118 ms
55,924 KB
testcase_14 AC 118 ms
56,284 KB
権限があれば一括ダウンロードができます

ソースコード

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