結果

問題 No.216 FAC
ユーザー ぴろずぴろず
提出日時 2015-05-26 22:35:24
言語 Java21
(openjdk 21)
結果
AC  
実行時間 152 ms / 1,000 ms
コード長 547 bytes
コンパイル時間 2,252 ms
コンパイル使用メモリ 74,016 KB
実行使用メモリ 54,632 KB
最終ジャッジ日時 2024-04-23 01:18:38
合計ジャッジ時間 6,268 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
53,876 KB
testcase_01 AC 110 ms
52,812 KB
testcase_02 AC 123 ms
54,104 KB
testcase_03 AC 152 ms
54,632 KB
testcase_04 AC 137 ms
54,224 KB
testcase_05 AC 130 ms
53,968 KB
testcase_06 AC 124 ms
54,032 KB
testcase_07 AC 123 ms
54,116 KB
testcase_08 AC 123 ms
53,792 KB
testcase_09 AC 99 ms
52,684 KB
testcase_10 AC 106 ms
52,696 KB
testcase_11 AC 117 ms
53,804 KB
testcase_12 AC 105 ms
52,960 KB
testcase_13 AC 116 ms
54,076 KB
testcase_14 AC 115 ms
54,052 KB
testcase_15 AC 113 ms
54,124 KB
testcase_16 AC 132 ms
54,108 KB
testcase_17 AC 132 ms
54,388 KB
testcase_18 AC 142 ms
54,100 KB
testcase_19 AC 124 ms
54,212 KB
testcase_20 AC 128 ms
54,404 KB
testcase_21 AC 139 ms
53,524 KB
testcase_22 AC 128 ms
54,184 KB
testcase_23 AC 139 ms
54,228 KB
testcase_24 AC 120 ms
53,248 KB
testcase_25 AC 128 ms
54,128 KB
testcase_26 AC 104 ms
52,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package no216;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n];
		int[] b = new int[n];
		for(int i=0;i<n;i++) {
			a[i] = sc.nextInt();
		}
		for(int i=0;i<n;i++) {
			b[i] = sc.nextInt();
		}
		int[] score = new int[111];
		for(int i=0;i<n;i++) {
			score[b[i]] += a[i];
		}
		int max = 0;
		for(int i=1;i<=100;i++) {
			max = Math.max(max, score[i]);
		}
		System.out.println(score[0] >= max ? "YES" : "NO");
	}

}
0