結果

問題 No.216 FAC
ユーザー maru
提出日時 2016-03-23 19:07:51
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 591 bytes
コンパイル時間 3,375 ms
コンパイル使用メモリ 74,812 KB
実行使用メモリ 54,568 KB
最終ジャッジ日時 2024-10-01 21:37:08
合計ジャッジ時間 7,446 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16 WA * 8
権限があれば一括ダウンロードができます

ソースコード

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