結果

問題 No.216 FAC
ユーザー cande398cande398
提出日時 2017-10-16 00:40:45
言語 Java21
(openjdk 21)
結果
AC  
実行時間 147 ms / 1,000 ms
コード長 596 bytes
コンパイル時間 3,769 ms
コンパイル使用メモリ 71,320 KB
実行使用メモリ 56,916 KB
最終ジャッジ日時 2023-08-11 05:23:00
合計ジャッジ時間 7,190 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,472 KB
testcase_01 AC 126 ms
55,572 KB
testcase_02 AC 124 ms
55,476 KB
testcase_03 AC 143 ms
55,576 KB
testcase_04 AC 137 ms
55,556 KB
testcase_05 AC 132 ms
55,648 KB
testcase_06 AC 128 ms
55,236 KB
testcase_07 AC 127 ms
55,564 KB
testcase_08 AC 132 ms
55,540 KB
testcase_09 AC 125 ms
55,532 KB
testcase_10 AC 128 ms
55,356 KB
testcase_11 AC 128 ms
55,496 KB
testcase_12 AC 126 ms
56,916 KB
testcase_13 AC 127 ms
55,552 KB
testcase_14 AC 128 ms
55,568 KB
testcase_15 AC 127 ms
55,524 KB
testcase_16 AC 143 ms
55,556 KB
testcase_17 AC 145 ms
55,412 KB
testcase_18 AC 145 ms
55,524 KB
testcase_19 AC 145 ms
55,980 KB
testcase_20 AC 145 ms
55,348 KB
testcase_21 AC 147 ms
56,300 KB
testcase_22 AC 147 ms
55,936 KB
testcase_23 AC 145 ms
55,276 KB
testcase_24 AC 146 ms
55,508 KB
testcase_25 AC 143 ms
55,516 KB
testcase_26 AC 126 ms
55,316 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