結果

問題 No.69 文字を自由に並び替え
ユーザー matsuyoshi30matsuyoshi30
提出日時 2016-02-05 18:29:41
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 5,000 ms
コード長 477 bytes
コンパイル時間 1,925 ms
コンパイル使用メモリ 72,420 KB
実行使用メモリ 56,536 KB
最終ジャッジ日時 2023-08-20 23:14:19
合計ジャッジ時間 4,614 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
56,264 KB
testcase_01 AC 116 ms
55,652 KB
testcase_02 AC 117 ms
56,324 KB
testcase_03 AC 114 ms
55,644 KB
testcase_04 AC 114 ms
56,180 KB
testcase_05 AC 112 ms
56,536 KB
testcase_06 AC 117 ms
55,772 KB
testcase_07 AC 117 ms
55,868 KB
testcase_08 AC 118 ms
56,100 KB
testcase_09 AC 115 ms
55,588 KB
testcase_10 AC 119 ms
54,236 KB
testcase_11 AC 120 ms
55,744 KB
testcase_12 AC 123 ms
55,768 KB
testcase_13 AC 116 ms
56,088 KB
testcase_14 AC 116 ms
56,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

class Test {
	public static void main(String[] args) throws Exception {
		Scanner in = new Scanner(System.in);

		char[] a = in.next().toCharArray();
		char[] b = in.next().toCharArray();

		Arrays.sort(a);
		Arrays.sort(b);
		boolean bool = true;

		for(int i=0; i<a.length; i++) {
			if(a[i] != b[i]) {
				bool = false;
			}
		}

		if(bool) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}
}
0