結果

問題 No.216 FAC
ユーザー YukimotoPGYukimotoPG
提出日時 2019-02-14 17:33:25
言語 Java21
(openjdk 21)
結果
AC  
実行時間 140 ms / 1,000 ms
コード長 499 bytes
コンパイル時間 2,156 ms
コンパイル使用メモリ 71,456 KB
実行使用メモリ 56,244 KB
最終ジャッジ日時 2023-10-11 12:42:39
合計ジャッジ時間 6,546 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,992 KB
testcase_01 AC 121 ms
55,516 KB
testcase_02 AC 123 ms
56,088 KB
testcase_03 AC 140 ms
55,940 KB
testcase_04 AC 132 ms
55,372 KB
testcase_05 AC 126 ms
56,104 KB
testcase_06 AC 120 ms
53,864 KB
testcase_07 AC 121 ms
56,144 KB
testcase_08 AC 121 ms
55,752 KB
testcase_09 AC 122 ms
55,684 KB
testcase_10 AC 122 ms
55,956 KB
testcase_11 AC 122 ms
55,680 KB
testcase_12 AC 122 ms
55,816 KB
testcase_13 AC 122 ms
55,912 KB
testcase_14 AC 122 ms
56,096 KB
testcase_15 AC 121 ms
55,320 KB
testcase_16 AC 139 ms
55,700 KB
testcase_17 AC 137 ms
55,932 KB
testcase_18 AC 138 ms
55,960 KB
testcase_19 AC 138 ms
56,244 KB
testcase_20 AC 138 ms
56,104 KB
testcase_21 AC 137 ms
55,872 KB
testcase_22 AC 139 ms
55,764 KB
testcase_23 AC 140 ms
55,940 KB
testcase_24 AC 139 ms
55,756 KB
testcase_25 AC 138 ms
56,236 KB
testcase_26 AC 120 ms
55,980 KB
権限があれば一括ダウンロードができます

ソースコード

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[101];
		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