結果

問題 No.216 FAC
ユーザー takeya_okinotakeya_okino
提出日時 2017-06-23 05:06:53
言語 Java19
(openjdk 21)
結果
AC  
実行時間 161 ms / 1,000 ms
コード長 585 bytes
コンパイル時間 4,150 ms
コンパイル使用メモリ 71,448 KB
実行使用メモリ 56,088 KB
最終ジャッジ日時 2023-07-25 19:10:31
合計ジャッジ時間 9,930 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 133 ms
53,408 KB
testcase_01 AC 140 ms
55,780 KB
testcase_02 AC 142 ms
55,456 KB
testcase_03 AC 158 ms
53,412 KB
testcase_04 AC 139 ms
54,052 KB
testcase_05 AC 143 ms
55,748 KB
testcase_06 AC 133 ms
55,784 KB
testcase_07 AC 134 ms
55,932 KB
testcase_08 AC 136 ms
55,700 KB
testcase_09 AC 133 ms
55,648 KB
testcase_10 AC 145 ms
55,912 KB
testcase_11 AC 135 ms
55,804 KB
testcase_12 AC 133 ms
55,668 KB
testcase_13 AC 134 ms
55,916 KB
testcase_14 AC 132 ms
55,764 KB
testcase_15 AC 136 ms
55,672 KB
testcase_16 AC 161 ms
55,640 KB
testcase_17 AC 158 ms
55,476 KB
testcase_18 AC 154 ms
55,728 KB
testcase_19 AC 155 ms
55,692 KB
testcase_20 AC 152 ms
55,792 KB
testcase_21 AC 153 ms
55,976 KB
testcase_22 AC 154 ms
55,764 KB
testcase_23 AC 151 ms
55,848 KB
testcase_24 AC 148 ms
56,088 KB
testcase_25 AC 154 ms
55,472 KB
testcase_26 AC 136 ms
55,644 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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[] score = new int[101];
    for(int i = 0; i < N; i++) {
      a[i] = sc.nextInt();
    }
    int[] b = new int[N];
    for(int i = 0; i < N; i++) {
      b[i] = sc.nextInt();
      score[b[i]] += a[i];  
    }
    int max = 0;
    for(int i = 1; i < 101; i++) {
      max = Math.max(max, score[i]);
    }
    String ans = "NO";
    if(max <= score[0]) ans = "YES";
    System.out.println(ans);
  }
}
0