結果

問題 No.69 文字を自由に並び替え
ユーザー fukuseifukusei
提出日時 2017-05-27 13:22:20
言語 Java21
(openjdk 21)
結果
AC  
実行時間 113 ms / 5,000 ms
コード長 523 bytes
コンパイル時間 3,500 ms
コンパイル使用メモリ 71,712 KB
実行使用メモリ 40,144 KB
最終ジャッジ日時 2023-08-20 23:41:17
合計ジャッジ時間 4,617 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 110 ms
39,268 KB
testcase_01 AC 111 ms
40,144 KB
testcase_02 AC 109 ms
39,540 KB
testcase_03 AC 109 ms
39,064 KB
testcase_04 AC 111 ms
39,744 KB
testcase_05 AC 110 ms
39,268 KB
testcase_06 AC 113 ms
39,052 KB
testcase_07 AC 113 ms
39,348 KB
testcase_08 AC 111 ms
39,304 KB
testcase_09 AC 113 ms
39,652 KB
testcase_10 AC 109 ms
39,268 KB
testcase_11 AC 109 ms
39,516 KB
testcase_12 AC 110 ms
39,464 KB
testcase_13 AC 111 ms
39,112 KB
testcase_14 AC 111 ms
39,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
class test{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String A = sc.next();
		char[] a = A.toCharArray();
		String B = sc.next();
		char[] b = B.toCharArray();
		String str  = "YES";
		
		for(int i=0; i<a.length; i++){
			for(int j=0; j<b.length; j++){
				if(a[i] != '0' && a[i] == b[j]){
					a[i] = '0';
					b[j] = '0';
				}
			}
		}
		
		for(int i=0; i<a.length; i++){
			if(a[i] != '0'){
				str = "NO";
				break;
			}
		}
		System.out.println(str);
	}
}
0