結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
55,660 KB
testcase_01 WA -
testcase_02 AC 116 ms
55,308 KB
testcase_03 AC 115 ms
55,876 KB
testcase_04 WA -
testcase_05 AC 116 ms
56,412 KB
testcase_06 AC 114 ms
55,560 KB
testcase_07 AC 114 ms
55,444 KB
testcase_08 AC 114 ms
55,572 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 112 ms
55,576 KB
testcase_12 AC 117 ms
55,928 KB
testcase_13 WA -
testcase_14 WA -
権限があれば一括ダウンロードができます

ソースコード

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'){
				System.out.println(a[i]);
				str = "NO";
				break;
			}
		}
		System.out.println(str);
	}
}
0