結果

問題 No.69 文字を自由に並び替え
ユーザー HEGO55
提出日時 2017-05-27 13:28:57
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 646 bytes
コンパイル時間 2,082 ms
コンパイル使用メモリ 74,140 KB
実行使用メモリ 41,380 KB
最終ジャッジ日時 2024-06-27 13:46:39
合計ジャッジ時間 4,602 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 8 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
class No69{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int count = 0;
		
		String str1 = sc.next(); char[] c1 = str1.toCharArray();
		String str2 = sc.next(); char[] c2 = str2.toCharArray();
		
	    if(c1.length == c2.length){
			for(int i=0; i<str1.length(); i++){
				for(int j=0; j<str2.length(); j++){
					if(c1[i] == c2[j]){
						c1[i] = '0';
						c2[i] = '0';
					}
				}
			}
	    }
		
		for(int i=0; i<str1.length(); i++){
			if(c1[i] == '0'){
				count++;
			}
		}
		
		if(count == str1.length()){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
	}
}
0