結果

問題 No.216 FAC
ユーザー marumaru
提出日時 2016-03-23 19:07:51
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 591 bytes
コンパイル時間 2,911 ms
コンパイル使用メモリ 74,652 KB
実行使用メモリ 54,440 KB
最終ジャッジ日時 2024-04-09 21:10:11
合計ジャッジ時間 7,234 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
53,084 KB
testcase_01 AC 116 ms
54,104 KB
testcase_02 AC 106 ms
52,892 KB
testcase_03 AC 130 ms
54,120 KB
testcase_04 AC 133 ms
54,028 KB
testcase_05 AC 118 ms
52,868 KB
testcase_06 AC 120 ms
54,168 KB
testcase_07 AC 117 ms
54,352 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 114 ms
53,380 KB
testcase_12 WA -
testcase_13 AC 118 ms
54,276 KB
testcase_14 WA -
testcase_15 AC 106 ms
53,012 KB
testcase_16 AC 128 ms
54,032 KB
testcase_17 AC 132 ms
54,300 KB
testcase_18 WA -
testcase_19 AC 131 ms
54,292 KB
testcase_20 WA -
testcase_21 AC 133 ms
53,960 KB
testcase_22 AC 132 ms
54,392 KB
testcase_23 AC 138 ms
53,988 KB
testcase_24 WA -
testcase_25 AC 129 ms
53,936 KB
testcase_26 AC 117 ms
53,744 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class yukicoder_216 {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt();
		
		int[] a = new int[n];
		int[] b = new int[n];
		
		for (int i = 0; i < n; i++) {
			a[i] = stdIn.nextInt();
		}
		
		for (int i = 0; i < n; i++) {
			b[i] = stdIn.nextInt();
		}
		
		int ok = 0;
		int ng = 0;
		
		for (int i = 0; i < n; i++) {
			if (b[i] == 0) {
				ok += a[i];
			} else {
				ng += a[i];
			}
		}
		
		if (ok >= ng) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}
}
0