結果

問題 No.216 FAC
ユーザー jimanojimano
提出日時 2018-01-22 19:16:37
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 853 bytes
コンパイル時間 4,390 ms
コンパイル使用メモリ 72,224 KB
実行使用メモリ 49,728 KB
最終ジャッジ日時 2023-08-26 22:03:59
合計ジャッジ時間 6,801 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
49,248 KB
testcase_01 AC 41 ms
49,280 KB
testcase_02 AC 41 ms
49,256 KB
testcase_03 AC 41 ms
49,368 KB
testcase_04 AC 40 ms
49,232 KB
testcase_05 AC 41 ms
47,384 KB
testcase_06 AC 40 ms
49,664 KB
testcase_07 AC 40 ms
49,728 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 41 ms
49,184 KB
testcase_12 WA -
testcase_13 AC 40 ms
47,212 KB
testcase_14 WA -
testcase_15 AC 40 ms
49,176 KB
testcase_16 AC 42 ms
49,148 KB
testcase_17 AC 42 ms
49,292 KB
testcase_18 WA -
testcase_19 AC 41 ms
49,192 KB
testcase_20 WA -
testcase_21 AC 45 ms
49,232 KB
testcase_22 AC 42 ms
49,240 KB
testcase_23 AC 41 ms
49,376 KB
testcase_24 WA -
testcase_25 AC 41 ms
49,364 KB
testcase_26 AC 39 ms
49,716 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 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();
		}
	}
}
0