結果

問題 No.216 FAC
ユーザー samplelpmassamplelpmas
提出日時 2016-11-28 09:05:17
言語 Java21
(openjdk 21)
結果
AC  
実行時間 143 ms / 1,000 ms
コード長 735 bytes
コンパイル時間 3,132 ms
コンパイル使用メモリ 71,312 KB
実行使用メモリ 57,764 KB
最終ジャッジ日時 2023-08-18 08:42:17
合計ジャッジ時間 7,834 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,716 KB
testcase_01 AC 121 ms
55,656 KB
testcase_02 AC 122 ms
56,000 KB
testcase_03 AC 139 ms
55,824 KB
testcase_04 AC 130 ms
55,952 KB
testcase_05 AC 126 ms
56,016 KB
testcase_06 AC 118 ms
55,632 KB
testcase_07 AC 118 ms
56,140 KB
testcase_08 AC 119 ms
55,436 KB
testcase_09 AC 118 ms
55,940 KB
testcase_10 AC 120 ms
55,676 KB
testcase_11 AC 119 ms
56,032 KB
testcase_12 AC 120 ms
56,336 KB
testcase_13 AC 119 ms
55,984 KB
testcase_14 AC 122 ms
56,060 KB
testcase_15 AC 121 ms
55,952 KB
testcase_16 AC 137 ms
55,824 KB
testcase_17 AC 135 ms
55,868 KB
testcase_18 AC 143 ms
55,812 KB
testcase_19 AC 136 ms
55,720 KB
testcase_20 AC 137 ms
55,532 KB
testcase_21 AC 139 ms
55,880 KB
testcase_22 AC 132 ms
56,324 KB
testcase_23 AC 131 ms
55,980 KB
testcase_24 AC 133 ms
57,764 KB
testcase_25 AC 133 ms
55,912 KB
testcase_26 AC 118 ms
55,620 KB
権限があれば一括ダウンロードができます

ソースコード

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