結果

問題 No.216 FAC
ユーザー jimanojimano
提出日時 2018-01-22 19:05:59
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 826 bytes
コンパイル時間 2,927 ms
コンパイル使用メモリ 71,696 KB
実行使用メモリ 49,756 KB
最終ジャッジ日時 2023-08-26 21:59:41
合計ジャッジ時間 5,083 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
49,260 KB
testcase_01 AC 41 ms
49,756 KB
testcase_02 AC 41 ms
49,360 KB
testcase_03 AC 42 ms
49,204 KB
testcase_04 AC 41 ms
49,384 KB
testcase_05 AC 41 ms
49,196 KB
testcase_06 AC 40 ms
49,200 KB
testcase_07 AC 41 ms
49,256 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 41 ms
49,264 KB
testcase_14 WA -
testcase_15 AC 42 ms
49,400 KB
testcase_16 AC 42 ms
49,276 KB
testcase_17 AC 42 ms
49,196 KB
testcase_18 WA -
testcase_19 AC 41 ms
49,248 KB
testcase_20 WA -
testcase_21 AC 42 ms
49,424 KB
testcase_22 AC 42 ms
49,296 KB
testcase_23 AC 42 ms
49,304 KB
testcase_24 WA -
testcase_25 AC 41 ms
49,284 KB
testcase_26 AC 41 ms
49,356 KB
権限があれば一括ダウンロードができます

ソースコード

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[cnt];
			int[] cntSolved = new int[cnt];
			int sumScore = 0;
			int kScore = 0;

			for (int i = 0; i < cnt; i++) {
				score[i] = Integer.parseInt(a[i]);
				cntSolved[i] = Integer.parseInt(b[i]);
				sumScore += score[i];
				kScore += cntSolved[i] == 0 ? score[i] : 0;
			}
			System.out.println((sumScore / 2) <= kScore ? "YES" : "NO");

		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
0