結果

問題 No.69 文字を自由に並び替え
ユーザー spaciaspacia
提出日時 2015-12-19 12:28:54
言語 Java21
(openjdk 21)
結果
AC  
実行時間 43 ms / 5,000 ms
コード長 511 bytes
コンパイル時間 2,043 ms
コンパイル使用メモリ 72,332 KB
実行使用メモリ 49,756 KB
最終ジャッジ日時 2023-08-20 23:12:51
合計ジャッジ時間 3,443 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
49,244 KB
testcase_01 AC 40 ms
49,308 KB
testcase_02 AC 40 ms
49,756 KB
testcase_03 AC 41 ms
49,304 KB
testcase_04 AC 41 ms
49,320 KB
testcase_05 AC 41 ms
49,408 KB
testcase_06 AC 40 ms
49,416 KB
testcase_07 AC 42 ms
49,212 KB
testcase_08 AC 41 ms
49,456 KB
testcase_09 AC 42 ms
49,088 KB
testcase_10 AC 41 ms
49,516 KB
testcase_11 AC 41 ms
49,360 KB
testcase_12 AC 43 ms
49,096 KB
testcase_13 AC 43 ms
49,248 KB
testcase_14 AC 41 ms
49,332 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;

class Main69 {
	
	public static char[] getCharSeq (String s) {
		char[] ret = new char[26];
		for (int i = 0; i < s.length(); i++)
			ret[(int)s.charAt(i) - 97]++;
		return ret;
	}
	
	public static void main (String[] args) throws IOException {
		BufferedReader br = 
			new BufferedReader(new InputStreamReader(System.in));
		
		String a = br.readLine();
		String b = br.readLine();
		
		System.out.println(Arrays.equals(getCharSeq(a),getCharSeq(b)) ? "YES" : "NO");
	}
}
0