結果

問題 No.216 FAC
ユーザー cande398cande398
提出日時 2017-10-16 00:40:45
言語 Java21
(openjdk 21)
結果
AC  
実行時間 155 ms / 1,000 ms
コード長 596 bytes
コンパイル時間 2,312 ms
コンパイル使用メモリ 74,344 KB
実行使用メモリ 41,948 KB
最終ジャッジ日時 2024-04-28 22:13:19
合計ジャッジ時間 7,041 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
41,680 KB
testcase_01 AC 133 ms
41,436 KB
testcase_02 AC 132 ms
41,288 KB
testcase_03 AC 143 ms
41,736 KB
testcase_04 AC 141 ms
41,564 KB
testcase_05 AC 138 ms
41,516 KB
testcase_06 AC 128 ms
41,112 KB
testcase_07 AC 130 ms
41,228 KB
testcase_08 AC 129 ms
41,144 KB
testcase_09 AC 115 ms
39,752 KB
testcase_10 AC 132 ms
41,444 KB
testcase_11 AC 132 ms
41,152 KB
testcase_12 AC 131 ms
41,492 KB
testcase_13 AC 134 ms
41,160 KB
testcase_14 AC 129 ms
41,160 KB
testcase_15 AC 131 ms
41,560 KB
testcase_16 AC 144 ms
41,552 KB
testcase_17 AC 146 ms
41,280 KB
testcase_18 AC 146 ms
41,792 KB
testcase_19 AC 146 ms
41,348 KB
testcase_20 AC 146 ms
41,696 KB
testcase_21 AC 146 ms
41,844 KB
testcase_22 AC 150 ms
41,948 KB
testcase_23 AC 143 ms
41,768 KB
testcase_24 AC 141 ms
41,288 KB
testcase_25 AC 155 ms
41,948 KB
testcase_26 AC 132 ms
41,304 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int[] sum = new int[101];
        int i, num = sc.nextInt();
        int[] score = new int[num];
        for(i=0;i<num;i++){
            score[i] = sc.nextInt();
        }
        for(i=0;i<num;i++){
            sum[sc.nextInt()] += score[i];
        }
        for(i=1;i<101;i++){
            if(sum[0] < sum[i]){
                System.out.println("NO");
                break;
            }
            if(i==100)System.out.println("YES");
        }
    }
}
0