結果

問題 No.69 文字を自由に並び替え
ユーザー k_kadorak_kadora
提出日時 2015-06-11 00:46:22
言語 Java21
(openjdk 21)
結果
AC  
実行時間 116 ms / 5,000 ms
コード長 436 bytes
コンパイル時間 3,306 ms
コンパイル使用メモリ 72,464 KB
実行使用メモリ 39,988 KB
最終ジャッジ日時 2023-08-20 23:02:11
合計ジャッジ時間 6,108 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
39,124 KB
testcase_01 AC 111 ms
39,988 KB
testcase_02 AC 113 ms
39,200 KB
testcase_03 AC 116 ms
39,864 KB
testcase_04 AC 112 ms
39,284 KB
testcase_05 AC 116 ms
39,092 KB
testcase_06 AC 113 ms
39,268 KB
testcase_07 AC 113 ms
39,248 KB
testcase_08 AC 112 ms
39,376 KB
testcase_09 AC 113 ms
39,624 KB
testcase_10 AC 116 ms
39,392 KB
testcase_11 AC 112 ms
39,088 KB
testcase_12 AC 114 ms
39,244 KB
testcase_13 AC 114 ms
39,244 KB
testcase_14 AC 115 ms
39,176 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.util.Arrays;
public class Moji{
	public static void main(String[] arg){
		Scanner sc = new Scanner(System.in);
		boolean b=true;
		char[] s1 = sc.next().toCharArray();
		char[] s2 = sc.next().toCharArray();
		Arrays.sort(s1);
		Arrays.sort(s2);
		for(int i = 0;i<s1.length;i++){
			if(s1[i] != s2[i])b=false;
		}
		if(b){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
	}
}
0