結果

問題 No.216 FAC
ユーザー jimanojimano
提出日時 2018-01-22 19:33:37
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 874 bytes
コンパイル時間 3,642 ms
コンパイル使用メモリ 73,848 KB
実行使用メモリ 49,540 KB
最終ジャッジ日時 2023-08-26 22:13:05
合計ジャッジ時間 5,150 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
49,132 KB
testcase_01 AC 42 ms
49,268 KB
testcase_02 AC 40 ms
49,356 KB
testcase_03 AC 41 ms
49,236 KB
testcase_04 AC 42 ms
49,296 KB
testcase_05 AC 41 ms
49,204 KB
testcase_06 AC 41 ms
49,476 KB
testcase_07 AC 41 ms
49,200 KB
testcase_08 AC 41 ms
49,348 KB
testcase_09 AC 41 ms
49,320 KB
testcase_10 AC 40 ms
49,324 KB
testcase_11 AC 40 ms
49,540 KB
testcase_12 AC 42 ms
49,024 KB
testcase_13 AC 41 ms
49,228 KB
testcase_14 AC 41 ms
49,128 KB
testcase_15 AC 42 ms
49,392 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 41 ms
49,208 KB
testcase_19 AC 41 ms
49,408 KB
testcase_20 AC 42 ms
49,192 KB
testcase_21 AC 44 ms
49,344 KB
testcase_22 AC 43 ms
49,332 KB
testcase_23 AC 43 ms
49,216 KB
testcase_24 AC 43 ms
49,236 KB
testcase_25 AC 42 ms
49,240 KB
testcase_26 AC 42 ms
49,532 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