結果

問題 No.69 文字を自由に並び替え
ユーザー HEGO55HEGO55
提出日時 2017-05-27 13:19:06
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 643 bytes
コンパイル時間 2,334 ms
コンパイル使用メモリ 71,512 KB
実行使用メモリ 56,136 KB
最終ジャッジ日時 2023-09-09 21:17:28
合計ジャッジ時間 4,550 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
56,040 KB
testcase_01 AC 111 ms
55,816 KB
testcase_02 AC 112 ms
55,652 KB
testcase_03 AC 112 ms
55,568 KB
testcase_04 WA -
testcase_05 AC 112 ms
56,136 KB
testcase_06 AC 112 ms
55,484 KB
testcase_07 AC 112 ms
55,688 KB
testcase_08 AC 112 ms
55,508 KB
testcase_09 AC 111 ms
55,316 KB
testcase_10 AC 112 ms
55,752 KB
testcase_11 AC 113 ms
55,720 KB
testcase_12 AC 113 ms
55,808 KB
testcase_13 AC 113 ms
55,792 KB
testcase_14 AC 113 ms
55,584 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';
						continue;
					}
				}
			}
	    }
		
		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