結果

問題 No.216 FAC
ユーザー yun_appyun_app
提出日時 2016-05-12 10:43:15
言語 Java21
(openjdk 21)
結果
AC  
実行時間 59 ms / 1,000 ms
コード長 962 bytes
コンパイル時間 2,139 ms
コンパイル使用メモリ 74,456 KB
実行使用メモリ 37,276 KB
最終ジャッジ日時 2024-04-23 01:43:23
合計ジャッジ時間 4,446 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
36,916 KB
testcase_01 AC 53 ms
36,936 KB
testcase_02 AC 57 ms
37,148 KB
testcase_03 AC 52 ms
37,144 KB
testcase_04 AC 52 ms
37,276 KB
testcase_05 AC 55 ms
37,100 KB
testcase_06 AC 52 ms
37,064 KB
testcase_07 AC 52 ms
37,116 KB
testcase_08 AC 52 ms
36,992 KB
testcase_09 AC 50 ms
37,016 KB
testcase_10 AC 50 ms
37,168 KB
testcase_11 AC 54 ms
36,848 KB
testcase_12 AC 51 ms
36,736 KB
testcase_13 AC 52 ms
37,100 KB
testcase_14 AC 59 ms
37,120 KB
testcase_15 AC 54 ms
36,728 KB
testcase_16 AC 51 ms
37,076 KB
testcase_17 AC 53 ms
36,728 KB
testcase_18 AC 54 ms
37,144 KB
testcase_19 AC 55 ms
36,984 KB
testcase_20 AC 52 ms
37,076 KB
testcase_21 AC 53 ms
36,848 KB
testcase_22 AC 53 ms
37,044 KB
testcase_23 AC 51 ms
36,724 KB
testcase_24 AC 51 ms
37,152 KB
testcase_25 AC 52 ms
36,992 KB
testcase_26 AC 50 ms
36,732 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
    public static void main (String[] args) throws java.lang.Exception
    {
        // your code goes here
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int[] player = new int[101];
        String[] points = br.readLine().split(" ");
        String[] calcs  = br.readLine().split(" ");
        for(int i=0;i<n;i++){
            int point = Integer.parseInt(points[i]);
            int calc  = Integer.parseInt(calcs[i]);
            player[calc] += point;
        }
        boolean flg = true;
        for(int i=1;i<101;i++){
            if(player[0] < player[i]){
                flg = false;
            }
        }
        System.out.println(flg?"YES":"NO");
    }

}
0