結果

問題 No.69 文字を自由に並び替え
ユーザー ohagi_1182ohagi_1182
提出日時 2017-10-21 10:22:48
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 453 bytes
コンパイル時間 2,659 ms
コンパイル使用メモリ 72,440 KB
実行使用メモリ 58,704 KB
最終ジャッジ日時 2023-09-09 21:22:49
合計ジャッジ時間 5,333 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 114 ms
56,528 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 112 ms
56,024 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 112 ms
56,004 KB
testcase_10 AC 112 ms
55,804 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 113 ms
56,180 KB
testcase_14 AC 113 ms
56,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String a = sc.next();
		String b = sc.next();
		char[] s1 = a.toCharArray();
		char[] s2 = b.toCharArray();
		Arrays.sort(s1); Arrays.sort(s2);
		for(int i = 0 ; i < a.length() ; i++) {
			if(s1[i] != s2[i]) {
				System.out.println("NO");
				return;
			}
		}
		System.out.println("Yes");
 	}
}

0