結果
問題 | No.216 FAC |
ユーザー |
|
提出日時 | 2018-01-22 19:28:39 |
言語 | Java (openjdk 23) |
結果 |
RE
|
実行時間 | - |
コード長 | 875 bytes |
コンパイル時間 | 4,685 ms |
コンパイル使用メモリ | 76,680 KB |
実行使用メモリ | 37,284 KB |
最終ジャッジ日時 | 2024-12-26 01:10:12 |
合計ジャッジ時間 | 7,041 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 1 RE * 1 |
other | AC * 4 WA * 6 RE * 14 |
ソースコード
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[100];int scoreK = 0;int max = 0;for (int i = 0; i < cnt; i++) {int tmp = Integer.parseInt(a[i]);int cntSolved = Integer.parseInt(b[i]);if (cntSolved == 0) {scoreK += score[i];}else {score[i - 1] = tmp;}}for (int i = 0; i < cnt; i++) {max = Math.max(max, score[i]);}System.out.println(max <= scoreK ? "YES" : "NO");} catch (IOException e) {e.printStackTrace();}}}