結果
| 問題 | No.216 FAC |
| コンテスト | |
| ユーザー |
maru
|
| 提出日時 | 2016-03-23 19:07:51 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 591 bytes |
| 記録 | |
| コンパイル時間 | 2,632 ms |
| コンパイル使用メモリ | 82,496 KB |
| 実行使用メモリ | 42,520 KB |
| 最終ジャッジ日時 | 2026-04-18 05:00:47 |
| 合計ジャッジ時間 | 5,579 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 16 WA * 8 |
ソースコード
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");
}
}
}
maru