結果

問題 No.216 FAC
ユーザー r.suzuki
提出日時 2015-12-13 17:53:43
言語 Java
(openjdk 23)
結果
RE  
実行時間 -
コード長 521 bytes
コンパイル時間 3,498 ms
コンパイル使用メモリ 74,864 KB
実行使用メモリ 54,528 KB
最終ジャッジ日時 2024-09-15 11:44:26
合計ジャッジ時間 8,107 ms
ジャッジサーバーID
(参考情報)
judge6 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9 RE * 15
権限があれば一括ダウンロードができます

ソースコード

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