結果

問題 No.69 文字を自由に並び替え
ユーザー Tsukasa_Type
提出日時 2018-02-09 14:14:39
言語 Java
(openjdk 23)
結果
AC  
実行時間 138 ms / 5,000 ms
コード長 377 bytes
コンパイル時間 2,352 ms
コンパイル使用メモリ 75,272 KB
実行使用メモリ 54,336 KB
最終ジャッジ日時 2024-12-14 06:56:33
合計ジャッジ時間 5,158 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		char[] a = sc.next().toCharArray();
		char[] b = sc.next().toCharArray();
		Arrays.sort(a);
		Arrays.sort(b);
		boolean F = true;
		for (int i=0; i<a.length; i++) {
			if (a[i]!=b[i]) {F = false;}
		}
		System.out.println(F==true?"YES":"NO");
	}
}
0