結果
問題 |
No.216 FAC
|
ユーザー |
|
提出日時 | 2018-01-22 19:16:37 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 853 bytes |
コンパイル時間 | 6,018 ms |
コンパイル使用メモリ | 73,320 KB |
実行使用メモリ | 37,068 KB |
最終ジャッジ日時 | 2024-12-26 01:03:01 |
合計ジャッジ時間 | 6,428 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 WA * 8 |
ソースコード
package me.yukicoder.lv1; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class No0216 { public static void main(String[] args) { try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) { int cnt = Integer.parseInt(br.readLine()); String[] a = br.readLine().split(" "); String[] b = br.readLine().split(" "); int[] score = new int[cnt]; int[] cntSolved = new int[cnt]; int scorenonK = 0; int scoreK = 0; for (int i = 0; i < cnt; i++) { score[i] = Integer.parseInt(a[i]); cntSolved[i] = Integer.parseInt(b[i]); if (cntSolved[i] == 0) { scoreK += score[i]; } else { scorenonK += score[i]; } } System.out.println(scorenonK <= scoreK ? "YES" : "NO"); } catch (IOException e) { e.printStackTrace(); } } }