結果

問題 No.216 FAC
ユーザー atkrymatkrym
提出日時 2016-10-23 18:04:32
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 756 bytes
コンパイル時間 2,141 ms
コンパイル使用メモリ 75,940 KB
実行使用メモリ 57,812 KB
最終ジャッジ日時 2023-08-15 18:00:09
合計ジャッジ時間 7,127 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,408 KB
testcase_01 AC 125 ms
56,124 KB
testcase_02 AC 123 ms
55,656 KB
testcase_03 RE -
testcase_04 AC 136 ms
55,792 KB
testcase_05 RE -
testcase_06 WA -
testcase_07 AC 126 ms
55,972 KB
testcase_08 AC 125 ms
55,712 KB
testcase_09 AC 126 ms
55,656 KB
testcase_10 AC 126 ms
55,660 KB
testcase_11 AC 125 ms
55,644 KB
testcase_12 AC 125 ms
55,692 KB
testcase_13 RE -
testcase_14 AC 127 ms
55,672 KB
testcase_15 RE -
testcase_16 AC 140 ms
55,948 KB
testcase_17 RE -
testcase_18 AC 146 ms
56,180 KB
testcase_19 RE -
testcase_20 RE -
testcase_21 AC 142 ms
55,908 KB
testcase_22 RE -
testcase_23 AC 143 ms
55,736 KB
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.math.*;
import java.text.*;

public class Main {
    private static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) throws Exception {
        int[] sum = new int[100];
        int[] score = new int[100];
        int n = sc.nextInt();
        
        for (int i = 0;i < n;i++) {
            score[i] = sc.nextInt();
        }
        
        for (int i = 0;i < n;i++) {
            sum[sc.nextInt()] += score[i];
        }
        
        int ret = 0;
        for (int i = 0;i < n;i++) {
            ret = Math.max(ret, sum[i]);
        }
        
        if (ret == sum[0]) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    }
}
0