結果

問題 No.69 文字を自由に並び替え
ユーザー kano_townkano_town
提出日時 2014-11-18 23:42:15
言語 Java21
(openjdk 21)
結果
AC  
実行時間 49 ms / 5,000 ms
コード長 636 bytes
コンパイル時間 3,390 ms
コンパイル使用メモリ 76,344 KB
実行使用メモリ 50,184 KB
最終ジャッジ日時 2023-08-20 22:28:13
合計ジャッジ時間 4,994 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
49,584 KB
testcase_01 AC 47 ms
49,612 KB
testcase_02 AC 49 ms
49,692 KB
testcase_03 AC 49 ms
49,784 KB
testcase_04 AC 49 ms
49,680 KB
testcase_05 AC 49 ms
49,472 KB
testcase_06 AC 49 ms
50,184 KB
testcase_07 AC 48 ms
49,616 KB
testcase_08 AC 48 ms
49,584 KB
testcase_09 AC 48 ms
47,696 KB
testcase_10 AC 47 ms
49,760 KB
testcase_11 AC 49 ms
49,668 KB
testcase_12 AC 49 ms
49,612 KB
testcase_13 AC 46 ms
49,624 KB
testcase_14 AC 46 ms
49,528 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Yukicoder69 {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String a = br.readLine();
		String b = br.readLine();

		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