結果

問題 No.216 FAC
ユーザー samplelpmas
提出日時 2016-11-28 09:05:17
言語 Java
(openjdk 23)
結果
AC  
実行時間 143 ms / 1,000 ms
コード長 735 bytes
コンパイル時間 2,342 ms
コンパイル使用メモリ 74,464 KB
実行使用メモリ 41,540 KB
最終ジャッジ日時 2024-11-27 12:33:21
合計ジャッジ時間 6,513 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int problems = sc.nextInt();

        int[] scores = new int[problems];
        int[] peopleScores = new int[101];

        for (int i = 0; i < problems; i++) {
            scores[i] = sc.nextInt();
        }

        for (int i = 0; i < problems; i++) {
            int personNo = sc.nextInt();
            peopleScores[personNo] += scores[i];
        }

        for (int i = 1; i < 101; i++) {

            if (peopleScores[0] < peopleScores[i]) {
                System.out.println("NO");
                return;
            }

        }

        System.out.println("YES");

    }

}
0