結果

問題 No.69 文字を自由に並び替え
ユーザー TatsuDXTatsuDX
提出日時 2016-09-08 23:43:09
言語 Java21
(openjdk 21)
結果
AC  
実行時間 117 ms / 5,000 ms
コード長 406 bytes
コンパイル時間 3,186 ms
コンパイル使用メモリ 72,968 KB
実行使用メモリ 56,680 KB
最終ジャッジ日時 2023-08-20 23:28:27
合計ジャッジ時間 5,654 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
56,076 KB
testcase_01 AC 113 ms
55,924 KB
testcase_02 AC 113 ms
56,680 KB
testcase_03 AC 112 ms
56,348 KB
testcase_04 AC 113 ms
55,876 KB
testcase_05 AC 113 ms
55,816 KB
testcase_06 AC 117 ms
55,608 KB
testcase_07 AC 114 ms
56,192 KB
testcase_08 AC 113 ms
56,524 KB
testcase_09 AC 115 ms
55,916 KB
testcase_10 AC 114 ms
56,136 KB
testcase_11 AC 114 ms
56,164 KB
testcase_12 AC 117 ms
56,132 KB
testcase_13 AC 116 ms
56,100 KB
testcase_14 AC 114 ms
56,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

		char[] c1 = sc.next().toCharArray(), c2 = sc.next().toCharArray();
		Arrays.sort(c1);
		Arrays.sort(c2);
		for(int i = 0; i < c1.length; i++){
			if(c1[i] != c2[i]){
				System.out.println("NO");
				return;
			}
		}
		System.out.println("YES");
	}
}
0