結果

問題 No.216 FAC
ユーザー ffmm00ffmm00
提出日時 2015-06-01 07:36:47
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 489 bytes
コンパイル時間 3,142 ms
コンパイル使用メモリ 72,440 KB
実行使用メモリ 56,480 KB
最終ジャッジ日時 2023-09-20 18:11:13
合計ジャッジ時間 7,885 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
54,456 KB
testcase_01 AC 122 ms
55,804 KB
testcase_02 AC 122 ms
53,716 KB
testcase_03 AC 137 ms
55,736 KB
testcase_04 AC 129 ms
55,784 KB
testcase_05 AC 129 ms
55,496 KB
testcase_06 AC 124 ms
55,948 KB
testcase_07 AC 123 ms
56,000 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 127 ms
56,076 KB
testcase_12 WA -
testcase_13 AC 126 ms
55,880 KB
testcase_14 WA -
testcase_15 AC 125 ms
55,908 KB
testcase_16 AC 141 ms
55,868 KB
testcase_17 AC 139 ms
55,796 KB
testcase_18 WA -
testcase_19 AC 142 ms
55,728 KB
testcase_20 WA -
testcase_21 AC 142 ms
55,804 KB
testcase_22 AC 143 ms
56,096 KB
testcase_23 AC 144 ms
56,112 KB
testcase_24 WA -
testcase_25 AC 143 ms
56,160 KB
testcase_26 AC 125 ms
56,188 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class N216 {

	public static void main(String[] args) {

		Scanner sca = new Scanner(System.in);
		int N = sca.nextInt();
		int a[] = new int[N];
		int b[] = new int[N];
		int K = 0;
		int L = 0;

		for (int i = 0; i < N; i++)
			a[i] = sca.nextInt();

		for (int i = 0; i < N; i++)
			b[i] = sca.nextInt();

		for (int i = 0; i < N; i++) {
			if (b[i] == 0)
				K += a[i];
			else
				L += a[i];
		}

		System.out.println((K >= L) ? "YES" : "NO");

	}

}
0