結果

問題 No.69 文字を自由に並び替え
ユーザー 8130Tsk8130Tsk
提出日時 2015-07-27 19:53:43
言語 Java21
(openjdk 21)
結果
AC  
実行時間 119 ms / 5,000 ms
コード長 478 bytes
コンパイル時間 4,593 ms
コンパイル使用メモリ 72,220 KB
実行使用メモリ 56,280 KB
最終ジャッジ日時 2023-08-20 23:03:53
合計ジャッジ時間 6,908 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
55,748 KB
testcase_01 AC 115 ms
55,920 KB
testcase_02 AC 116 ms
55,948 KB
testcase_03 AC 113 ms
55,840 KB
testcase_04 AC 113 ms
55,764 KB
testcase_05 AC 119 ms
55,660 KB
testcase_06 AC 114 ms
55,944 KB
testcase_07 AC 115 ms
56,080 KB
testcase_08 AC 114 ms
55,684 KB
testcase_09 AC 115 ms
56,084 KB
testcase_10 AC 116 ms
55,732 KB
testcase_11 AC 118 ms
56,068 KB
testcase_12 AC 118 ms
55,780 KB
testcase_13 AC 112 ms
56,280 KB
testcase_14 AC 115 ms
56,044 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.Scanner;

public class No69 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		
		char[] a=sc.next().toCharArray();
		char[] b=sc.next().toCharArray();
		
		Arrays.sort(a);
		Arrays.sort(b);
		boolean t=true;
		
		for(int i=0; i<a.length; i++){
			if(a[i] != b[i]) t=false;
		}
		
		if(t)
			System.out.println("YES");
		else
			System.out.println("NO");
	

	}

}
0