結果

問題 No.216 FAC
ユーザー ぴろずぴろず
提出日時 2015-05-26 22:22:23
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 544 bytes
コンパイル時間 3,738 ms
コンパイル使用メモリ 72,096 KB
実行使用メモリ 56,292 KB
最終ジャッジ日時 2023-09-20 13:57:19
合計ジャッジ時間 8,640 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,620 KB
testcase_01 AC 124 ms
55,500 KB
testcase_02 AC 125 ms
55,588 KB
testcase_03 AC 141 ms
55,796 KB
testcase_04 AC 133 ms
55,792 KB
testcase_05 AC 133 ms
55,436 KB
testcase_06 WA -
testcase_07 AC 125 ms
55,400 KB
testcase_08 AC 125 ms
53,400 KB
testcase_09 AC 124 ms
55,372 KB
testcase_10 AC 125 ms
55,792 KB
testcase_11 AC 127 ms
55,876 KB
testcase_12 AC 124 ms
55,932 KB
testcase_13 WA -
testcase_14 AC 125 ms
55,752 KB
testcase_15 WA -
testcase_16 AC 141 ms
55,748 KB
testcase_17 AC 142 ms
55,736 KB
testcase_18 AC 147 ms
55,424 KB
testcase_19 AC 141 ms
55,988 KB
testcase_20 AC 142 ms
55,424 KB
testcase_21 AC 142 ms
55,668 KB
testcase_22 AC 139 ms
55,716 KB
testcase_23 AC 141 ms
55,884 KB
testcase_24 AC 142 ms
55,660 KB
testcase_25 AC 144 ms
55,784 KB
testcase_26 AC 125 ms
55,592 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[101];
		for(int i=0;i<n;i++) {
			score[b[i]] += a[i];
		}
		int max = 0;
		for(int i=1;i<n;i++) {
			max = Math.max(max, score[i]);
		}
		System.out.println(score[0] >= max ? "YES" : "NO");
	}

}
0