結果

問題 No.216 FAC
ユーザー spaciaspacia
提出日時 2016-01-02 08:18:11
言語 Java21
(openjdk 21)
結果
AC  
実行時間 51 ms / 1,000 ms
コード長 750 bytes
コンパイル時間 2,191 ms
コンパイル使用メモリ 74,560 KB
実行使用メモリ 50,448 KB
最終ジャッジ日時 2024-04-23 01:30:37
合計ジャッジ時間 3,869 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
50,044 KB
testcase_01 AC 50 ms
50,304 KB
testcase_02 AC 51 ms
50,224 KB
testcase_03 AC 51 ms
50,176 KB
testcase_04 AC 49 ms
50,268 KB
testcase_05 AC 48 ms
50,292 KB
testcase_06 AC 47 ms
49,996 KB
testcase_07 AC 48 ms
50,304 KB
testcase_08 AC 48 ms
50,052 KB
testcase_09 AC 48 ms
50,448 KB
testcase_10 AC 49 ms
50,372 KB
testcase_11 AC 49 ms
50,216 KB
testcase_12 AC 49 ms
49,916 KB
testcase_13 AC 49 ms
50,100 KB
testcase_14 AC 47 ms
50,212 KB
testcase_15 AC 47 ms
49,912 KB
testcase_16 AC 49 ms
50,192 KB
testcase_17 AC 50 ms
50,224 KB
testcase_18 AC 50 ms
50,296 KB
testcase_19 AC 50 ms
50,316 KB
testcase_20 AC 49 ms
50,332 KB
testcase_21 AC 48 ms
50,280 KB
testcase_22 AC 49 ms
50,268 KB
testcase_23 AC 48 ms
50,132 KB
testcase_24 AC 49 ms
50,300 KB
testcase_25 AC 49 ms
50,252 KB
testcase_26 AC 47 ms
50,264 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