結果

問題 No.216 FAC
ユーザー r.suzukir.suzuki
提出日時 2015-12-13 17:53:43
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 521 bytes
コンパイル時間 3,225 ms
コンパイル使用メモリ 71,984 KB
実行使用メモリ 57,996 KB
最終ジャッジ日時 2023-10-13 14:58:33
合計ジャッジ時間 7,957 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,940 KB
testcase_01 AC 125 ms
56,084 KB
testcase_02 AC 125 ms
56,016 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 AC 125 ms
55,940 KB
testcase_08 AC 125 ms
55,876 KB
testcase_09 AC 126 ms
56,072 KB
testcase_10 AC 124 ms
56,160 KB
testcase_11 AC 126 ms
55,484 KB
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 141 ms
56,268 KB
testcase_17 RE -
testcase_18 AC 141 ms
55,808 KB
testcase_19 RE -
testcase_20 RE -
testcase_21 AC 142 ms
55,980 KB
testcase_22 RE -
testcase_23 AC 140 ms
55,792 KB
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

public class No_216 {

	public static void main(String[] args) {
		java.util.Scanner sc = new java.util.Scanner(System.in);
		int n = sc.nextInt();
		int[] score = new int[n];
		int[] user = new int[n];

		for (int i = 0; i < n; i++) {
			score[i] = sc.nextInt();
		}
		for (int i = 0; i < n; i++) {
			int j = sc.nextInt();
			user[j] += score[i];
		}
		int kScore = user[0];
		java.util.Arrays.sort(user);
		int maxScore = user[n - 1];
		String ans = kScore >= maxScore ? "YES" : "NO";
		System.out.println(ans);

	}

}
0