結果

問題 No.216 FAC
ユーザー jimanojimano
提出日時 2018-01-22 19:28:39
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 875 bytes
コンパイル時間 5,108 ms
コンパイル使用メモリ 73,824 KB
実行使用メモリ 51,540 KB
最終ジャッジ日時 2023-08-26 22:08:42
合計ジャッジ時間 5,491 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
49,220 KB
testcase_01 RE -
testcase_02 WA -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 AC 44 ms
49,156 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 RE -
testcase_11 AC 43 ms
49,272 KB
testcase_12 WA -
testcase_13 AC 43 ms
49,216 KB
testcase_14 WA -
testcase_15 AC 42 ms
47,368 KB
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 WA -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 WA -
testcase_25 RE -
testcase_26 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

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();
		}
	}
}
0