結果

問題 No.216 FAC
ユーザー YukimotoPGYukimotoPG
提出日時 2019-02-14 17:32:39
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 497 bytes
コンパイル時間 2,051 ms
コンパイル使用メモリ 71,872 KB
実行使用メモリ 57,952 KB
最終ジャッジ日時 2023-10-11 12:42:31
合計ジャッジ時間 7,404 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,732 KB
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 AC 120 ms
56,156 KB
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 137 ms
55,980 KB
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 AC 139 ms
55,936 KB
testcase_22 RE -
testcase_23 AC 139 ms
55,516 KB
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		
		int n = sc.nextInt();
		int[] score = new int[n];
		for (int i=0; i<n; i++) score[i] = sc.nextInt();
		
		int[] competitors = new int[n];
		for (int i=0; i<n; i++) {
			competitors[sc.nextInt()] += score[i];
		}
		
		for (int i=1; i<=100; i++) {
			if (competitors[0] < competitors[i]) {
				System.out.println("NO"); return;
			}
		}
		System.out.println("YES");
		
	}
}
0