結果

問題 No.69 文字を自由に並び替え
ユーザー HEGO55HEGO55
提出日時 2017-05-27 13:29:29
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 646 bytes
コンパイル時間 1,936 ms
コンパイル使用メモリ 71,712 KB
実行使用メモリ 58,176 KB
最終ジャッジ日時 2023-09-09 21:18:01
合計ジャッジ時間 4,512 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
55,664 KB
testcase_01 AC 114 ms
55,756 KB
testcase_02 AC 114 ms
55,592 KB
testcase_03 WA -
testcase_04 AC 114 ms
55,788 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 116 ms
55,964 KB
testcase_10 AC 115 ms
55,916 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 114 ms
55,968 KB
testcase_14 AC 112 ms
55,856 KB
権限があれば一括ダウンロードができます

ソースコード

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] = '1';
					}
				}
			}
	    }
		
		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