結果

問題 No.216 FAC
ユーザー spaciaspacia
提出日時 2016-01-02 08:18:11
言語 Java19
(openjdk 21)
結果
AC  
実行時間 42 ms / 1,000 ms
コード長 750 bytes
コンパイル時間 1,879 ms
コンパイル使用メモリ 71,572 KB
実行使用メモリ 49,756 KB
最終ジャッジ日時 2023-08-05 02:56:01
合計ジャッジ時間 4,071 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
49,424 KB
testcase_01 AC 40 ms
49,520 KB
testcase_02 AC 39 ms
49,256 KB
testcase_03 AC 41 ms
49,756 KB
testcase_04 AC 40 ms
49,356 KB
testcase_05 AC 39 ms
49,360 KB
testcase_06 AC 39 ms
49,136 KB
testcase_07 AC 39 ms
49,344 KB
testcase_08 AC 39 ms
49,584 KB
testcase_09 AC 39 ms
49,360 KB
testcase_10 AC 40 ms
49,464 KB
testcase_11 AC 40 ms
49,248 KB
testcase_12 AC 40 ms
49,524 KB
testcase_13 AC 39 ms
49,460 KB
testcase_14 AC 39 ms
47,536 KB
testcase_15 AC 39 ms
49,548 KB
testcase_16 AC 41 ms
49,468 KB
testcase_17 AC 42 ms
49,452 KB
testcase_18 AC 41 ms
49,720 KB
testcase_19 AC 41 ms
49,476 KB
testcase_20 AC 41 ms
49,312 KB
testcase_21 AC 41 ms
49,408 KB
testcase_22 AC 41 ms
49,448 KB
testcase_23 AC 41 ms
49,268 KB
testcase_24 AC 42 ms
49,400 KB
testcase_25 AC 41 ms
49,612 KB
testcase_26 AC 40 ms
49,476 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;

class Main216 {
	
	public static void out (Object o) {
		System.out.println(o);
	}
	
	public static void main (String[] args) throws IOException {
		BufferedReader br = 
			new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		int max = 100;
		int[] score = new int[max + 1];
		String[] line1 = br.readLine().split(" ");
		String[] line2 = br.readLine().split(" ");
		
		for (int i = 0; i < n; i++) {
			int s = Integer.parseInt(line1[i]);
			int w = Integer.parseInt(line2[i]);
			score[w] += s;
		}
		
		int maxScore = -1;
		for (int i = 1; i <= max; i++) {
			maxScore = Math.max(maxScore , score[i]);
		}
		
		out(score[0] >= maxScore ? "YES" : "NO");
		
	}
}
0