結果

問題 No.216 FAC
ユーザー r.suzukir.suzuki
提出日時 2015-12-13 18:11:14
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 575 bytes
コンパイル時間 3,403 ms
コンパイル使用メモリ 72,608 KB
実行使用メモリ 57,788 KB
最終ジャッジ日時 2023-10-13 14:59:04
合計ジャッジ時間 8,139 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
56,012 KB
testcase_01 AC 128 ms
55,740 KB
testcase_02 AC 127 ms
55,920 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 AC 124 ms
55,860 KB
testcase_08 AC 126 ms
55,656 KB
testcase_09 AC 127 ms
55,452 KB
testcase_10 AC 128 ms
55,996 KB
testcase_11 AC 129 ms
55,956 KB
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 143 ms
55,628 KB
testcase_17 RE -
testcase_18 AC 143 ms
55,776 KB
testcase_19 RE -
testcase_20 RE -
testcase_21 AC 141 ms
56,344 KB
testcase_22 RE -
testcase_23 AC 142 ms
55,960 KB
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

public class No_216 {

	public static void main(String[] args) {
		java.util.Scanner sc = new java.util.Scanner(System.in);
		int n = sc.nextInt();
		int[] score = new int[n];
		int[] user = new int[n];

		for (int i = 0; i < n; i++) {
			score[i] = sc.nextInt();
		}
		for (int i = 0; i < n; i++) {
			int j = sc.nextInt();
			user[j] += score[i];
		}
		sc.close();

		boolean b = true;
		for (int i = 1; i < n; i++) {
			if (user[0] < user[i]) {
				b = false;
				break;
			}
		}

		if (b) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}

	}

}
0