結果

問題 No.216 FAC
ユーザー r.suzukir.suzuki
提出日時 2015-12-13 17:57:40
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 539 bytes
コンパイル時間 2,707 ms
コンパイル使用メモリ 72,216 KB
実行使用メモリ 56,924 KB
最終ジャッジ日時 2023-10-13 14:58:53
合計ジャッジ時間 6,879 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 110 ms
56,168 KB
testcase_01 AC 113 ms
56,056 KB
testcase_02 AC 121 ms
55,732 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 AC 106 ms
55,572 KB
testcase_08 AC 110 ms
55,708 KB
testcase_09 AC 116 ms
55,784 KB
testcase_10 AC 111 ms
56,088 KB
testcase_11 AC 110 ms
55,988 KB
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 124 ms
56,256 KB
testcase_17 RE -
testcase_18 AC 122 ms
56,172 KB
testcase_19 RE -
testcase_20 RE -
testcase_21 AC 127 ms
56,264 KB
testcase_22 RE -
testcase_23 AC 122 ms
55,864 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];
		}
		sc.close();
		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