結果

問題 No.69 文字を自由に並び替え
ユーザー kano_townkano_town
提出日時 2014-11-19 09:54:22
言語 Java21
(openjdk 21)
結果
AC  
実行時間 140 ms / 5,000 ms
コード長 498 bytes
コンパイル時間 5,616 ms
コンパイル使用メモリ 75,344 KB
実行使用メモリ 55,820 KB
最終ジャッジ日時 2023-08-20 22:29:23
合計ジャッジ時間 8,795 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,688 KB
testcase_01 AC 125 ms
55,560 KB
testcase_02 AC 126 ms
55,820 KB
testcase_03 AC 125 ms
53,552 KB
testcase_04 AC 125 ms
55,744 KB
testcase_05 AC 126 ms
55,712 KB
testcase_06 AC 127 ms
55,692 KB
testcase_07 AC 128 ms
55,768 KB
testcase_08 AC 124 ms
55,792 KB
testcase_09 AC 122 ms
55,636 KB
testcase_10 AC 121 ms
55,756 KB
testcase_11 AC 122 ms
55,640 KB
testcase_12 AC 128 ms
55,816 KB
testcase_13 AC 140 ms
55,704 KB
testcase_14 AC 140 ms
55,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Yukicoder69 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String a = sc.next();
		String b = sc.next();

		for (int i = 0; i < a.length(); i++) {
			if (b.contains("" + a.charAt(i)))
				b = b.substring(0, b.indexOf(a.charAt(i))) + b.substring(b.indexOf(a.charAt(i)) + 1, b.length());
		}
		
		if (b.equals("")) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}

	}

}
0