結果

問題 No.69 文字を自由に並び替え
ユーザー Suunn
提出日時 2018-11-20 05:47:14
言語 Java
(openjdk 23)
結果
AC  
実行時間 136 ms / 5,000 ms
コード長 482 bytes
コンパイル時間 2,075 ms
コンパイル使用メモリ 74,660 KB
実行使用メモリ 54,340 KB
最終ジャッジ日時 2024-12-14 07:14:50
合計ジャッジ時間 4,758 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
	

public class Main{
	
	
	public static void main(String args[])throws Exception{
		
		Scanner sc = new Scanner(System.in);
		String A = sc.next();
		String B = sc.next();
		int L = A.length();
		char[] a = new char[26];
		char[] b = new char[26];
		for(int i=0;i<L;i++){
			a[A.charAt(i)-'a']++;
			b[B.charAt(i)-'a']++;
		}
		for(int i=0;i<26;i++){
			if(a[i]!=b[i]){
				System.out.println("NO");
				return;
			}
		}
		System.out.println("YES");
	}
}
0