結果
問題 |
No.69 文字を自由に並び替え
|
ユーザー |
![]() |
提出日時 | 2016-10-28 01:52:23 |
言語 | Java (openjdk 23) |
結果 |
RE
|
実行時間 | - |
コード長 | 766 bytes |
コンパイル時間 | 2,242 ms |
コンパイル使用メモリ | 74,368 KB |
実行使用メモリ | 41,592 KB |
最終ジャッジ日時 | 2024-06-27 13:36:02 |
合計ジャッジ時間 | 4,683 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | RE * 15 |
ソースコード
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int NUM_LETTERS = 26; String A = sc.next(); String B = sc.next(); int[] letterCountA = new int[NUM_LETTERS]; int[] letterCountB = new int[NUM_LETTERS]; for (int i = 0; i < NUM_LETTERS; i++) { letterCountA[A.charAt(i) - 'a']++; letterCountB[B.charAt(i) - 'a']++; } boolean isSame = true; for (int i = 0; i < NUM_LETTERS; i++) { if (letterCountA[i] != letterCountB[i]) { isSame = false; break; } } System.out.println(isSame? "YES" : "NO"); } }