結果

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

ソースコード

diff #

import java.util.*;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		char s[]=sc.next().toCharArray();
		char t[]=sc.next().toCharArray();
		int S[]=new int[30];
		int T[]=new int[30];
		for(int i=0;i<s.length;i++){
		   int x=s[i]-'a';
		   S[x]++;
		   x=t[i]-'a';
		   T[x]++;
		}
		String ans="YES";
		for(int i=0;i<30;i++){
			if(S[i]!=T[i])ans="NO";
		}
		System.out.println(ans);
	}}
0