結果

問題 No.216 FAC
ユーザー bellbell
提出日時 2021-03-05 19:47:25
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 560 bytes
コンパイル時間 2,247 ms
コンパイル使用メモリ 78,320 KB
実行使用メモリ 41,820 KB
最終ジャッジ日時 2024-04-16 07:34:55
合計ジャッジ時間 7,245 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
39,840 KB
testcase_01 AC 133 ms
41,000 KB
testcase_02 AC 132 ms
41,224 KB
testcase_03 AC 146 ms
41,656 KB
testcase_04 AC 139 ms
41,400 KB
testcase_05 AC 137 ms
40,996 KB
testcase_06 AC 128 ms
41,296 KB
testcase_07 AC 130 ms
41,344 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 136 ms
41,472 KB
testcase_12 WA -
testcase_13 AC 117 ms
40,044 KB
testcase_14 WA -
testcase_15 AC 138 ms
41,124 KB
testcase_16 AC 153 ms
41,568 KB
testcase_17 AC 154 ms
41,496 KB
testcase_18 WA -
testcase_19 AC 147 ms
41,588 KB
testcase_20 WA -
testcase_21 AC 149 ms
41,452 KB
testcase_22 AC 149 ms
41,472 KB
testcase_23 AC 146 ms
41,540 KB
testcase_24 WA -
testcase_25 AC 148 ms
41,520 KB
testcase_26 AC 131 ms
41,052 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.HashSet;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int ans = 0, ans2 = 0;
		int [] a = new int[n];
		int [] b = new int[n];

		for (int i = 0; i < n; i++) {
			a[i] = sc.nextInt();
		}
		for (int i = 0; i < n; i++) {
			b[i] = sc.nextInt();
		if (b[i] != 0) ans += a[i];
		else if (b[i] == 0)  ans2 += a[i];
		}
		if (ans <= ans2) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
		sc.close();
    }
}
0