結果

問題 No.216 FAC
ユーザー jimanojimano
提出日時 2018-01-22 19:36:15
言語 Java21
(openjdk 21)
結果
AC  
実行時間 46 ms / 1,000 ms
コード長 875 bytes
コンパイル時間 3,277 ms
コンパイル使用メモリ 74,488 KB
実行使用メモリ 49,688 KB
最終ジャッジ日時 2023-08-26 22:13:45
合計ジャッジ時間 5,340 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
49,256 KB
testcase_01 AC 41 ms
49,160 KB
testcase_02 AC 41 ms
49,228 KB
testcase_03 AC 42 ms
49,264 KB
testcase_04 AC 41 ms
49,392 KB
testcase_05 AC 40 ms
49,260 KB
testcase_06 AC 39 ms
49,060 KB
testcase_07 AC 40 ms
49,324 KB
testcase_08 AC 41 ms
49,420 KB
testcase_09 AC 40 ms
49,280 KB
testcase_10 AC 40 ms
49,308 KB
testcase_11 AC 40 ms
49,268 KB
testcase_12 AC 40 ms
49,124 KB
testcase_13 AC 40 ms
49,308 KB
testcase_14 AC 40 ms
49,136 KB
testcase_15 AC 42 ms
49,152 KB
testcase_16 AC 42 ms
49,216 KB
testcase_17 AC 42 ms
49,140 KB
testcase_18 AC 43 ms
49,332 KB
testcase_19 AC 41 ms
49,240 KB
testcase_20 AC 43 ms
49,260 KB
testcase_21 AC 42 ms
49,240 KB
testcase_22 AC 46 ms
49,272 KB
testcase_23 AC 42 ms
49,236 KB
testcase_24 AC 42 ms
49,688 KB
testcase_25 AC 42 ms
49,160 KB
testcase_26 AC 41 ms
49,348 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[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 += tmp;
				} else {
					score[cntSolved - 1] += tmp;
				}
			}
			for (int i = 0; i < 100; i++) {
				max = Math.max(max, score[i]);
			}
			System.out.println(max <= scoreK ? "YES" : "NO");

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