結果
| 問題 | No.216 FAC |
| コンテスト | |
| ユーザー |
maru
|
| 提出日時 | 2016-03-23 19:07:51 |
| 言語 | Java (openjdk 26.0.2.1 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 591 bytes |
| 記録 | |
| コンパイル時間 | 2,399 ms |
| コンパイル使用メモリ | 85,628 KB |
| 実行使用メモリ | 45,920 KB |
| 最終ジャッジ日時 | 2026-09-08 07:07:00 |
| 合計ジャッジ時間 | 5,709 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / 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