結果

問題 No.216 FAC
ユーザー iga_xxiga_xx
提出日時 2015-05-26 22:25:07
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 633 bytes
コンパイル時間 1,994 ms
コンパイル使用メモリ 72,268 KB
実行使用メモリ 57,776 KB
最終ジャッジ日時 2023-09-20 14:10:52
合計ジャッジ時間 6,745 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,484 KB
testcase_01 AC 123 ms
56,080 KB
testcase_02 AC 124 ms
55,836 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 AC 125 ms
55,612 KB
testcase_08 AC 124 ms
55,928 KB
testcase_09 AC 126 ms
55,760 KB
testcase_10 AC 126 ms
56,036 KB
testcase_11 AC 126 ms
55,448 KB
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 140 ms
55,708 KB
testcase_17 RE -
testcase_18 AC 142 ms
55,852 KB
testcase_19 RE -
testcase_20 RE -
testcase_21 AC 139 ms
55,400 KB
testcase_22 RE -
testcase_23 AC 140 ms
55,328 KB
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

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

        for(int i=0; i<n; i++){
            a[i] = sc.nextInt();
        }
        for(int i=0; i<n; i++){
            b = sc.nextInt();
            user[b] += a[i];
        }

        for(int i=1; i<n; i++){
            if(user[0] < user[i]){
                System.out.println("NO");
                System.exit(0);
            }
        }

        System.out.println("YES");
    }
}
0