結果

問題 No.216 FAC
ユーザー jimanojimano
提出日時 2018-01-22 19:32:14
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 874 bytes
コンパイル時間 3,371 ms
コンパイル使用メモリ 74,384 KB
実行使用メモリ 51,236 KB
最終ジャッジ日時 2023-08-26 22:12:13
合計ジャッジ時間 6,516 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
47,176 KB
testcase_01 AC 41 ms
49,132 KB
testcase_02 AC 41 ms
49,208 KB
testcase_03 AC 43 ms
51,236 KB
testcase_04 AC 42 ms
49,116 KB
testcase_05 AC 41 ms
49,052 KB
testcase_06 AC 41 ms
49,320 KB
testcase_07 AC 41 ms
49,128 KB
testcase_08 AC 41 ms
49,208 KB
testcase_09 AC 41 ms
49,028 KB
testcase_10 AC 42 ms
49,232 KB
testcase_11 AC 41 ms
49,092 KB
testcase_12 AC 41 ms
49,196 KB
testcase_13 WA -
testcase_14 AC 45 ms
49,156 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 43 ms
49,152 KB
testcase_19 AC 42 ms
49,328 KB
testcase_20 AC 43 ms
49,136 KB
testcase_21 AC 43 ms
49,548 KB
testcase_22 AC 42 ms
47,740 KB
testcase_23 AC 43 ms
49,488 KB
testcase_24 AC 43 ms
49,288 KB
testcase_25 AC 43 ms
49,432 KB
testcase_26 AC 46 ms
49,252 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 < cnt; i++) {
				max = Math.max(max, score[i]);
			}
			System.out.println(max <= scoreK ? "YES" : "NO");

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