結果

問題 No.69 文字を自由に並び替え
ユーザー omc-testomc-test
提出日時 2016-08-04 16:40:12
言語 Java21
(openjdk 21)
結果
AC  
実行時間 121 ms / 5,000 ms
コード長 628 bytes
コンパイル時間 3,560 ms
コンパイル使用メモリ 83,832 KB
実行使用メモリ 56,420 KB
最終ジャッジ日時 2023-08-20 23:26:24
合計ジャッジ時間 6,001 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
56,176 KB
testcase_01 AC 120 ms
56,212 KB
testcase_02 AC 121 ms
56,288 KB
testcase_03 AC 119 ms
55,956 KB
testcase_04 AC 118 ms
55,824 KB
testcase_05 AC 120 ms
55,980 KB
testcase_06 AC 119 ms
55,504 KB
testcase_07 AC 121 ms
56,420 KB
testcase_08 AC 121 ms
55,904 KB
testcase_09 AC 119 ms
56,364 KB
testcase_10 AC 120 ms
55,860 KB
testcase_11 AC 118 ms
56,020 KB
testcase_12 AC 118 ms
55,888 KB
testcase_13 AC 119 ms
56,128 KB
testcase_14 AC 119 ms
55,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
public class No0069 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String a = sc.nextLine();
		String b = sc.nextLine();
		List<String> aList = new ArrayList<String>();
		List<String> bList = new ArrayList<String>();
		for(int i=0; i<a.length(); i++){
			aList.add(a.substring(i, i+1));
			bList.add(b.substring(i, i+1));
		}
		Collections.sort(aList);
		Collections.sort(bList);
		if(aList.equals(bList)){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
	}
}
0