結果

問題 No.216 FAC
ユーザー takeya_okinotakeya_okino
提出日時 2017-06-23 05:06:53
言語 Java21
(openjdk 21)
結果
AC  
実行時間 157 ms / 1,000 ms
コード長 585 bytes
コンパイル時間 2,047 ms
コンパイル使用メモリ 74,704 KB
実行使用メモリ 54,516 KB
最終ジャッジ日時 2024-04-10 10:44:32
合計ジャッジ時間 6,923 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
53,844 KB
testcase_01 AC 131 ms
54,020 KB
testcase_02 AC 132 ms
54,372 KB
testcase_03 AC 146 ms
54,400 KB
testcase_04 AC 139 ms
54,024 KB
testcase_05 AC 137 ms
54,076 KB
testcase_06 AC 131 ms
53,956 KB
testcase_07 AC 131 ms
54,168 KB
testcase_08 AC 132 ms
54,084 KB
testcase_09 AC 132 ms
54,116 KB
testcase_10 AC 131 ms
54,048 KB
testcase_11 AC 133 ms
54,268 KB
testcase_12 AC 132 ms
54,404 KB
testcase_13 AC 133 ms
54,216 KB
testcase_14 AC 135 ms
54,516 KB
testcase_15 AC 133 ms
54,216 KB
testcase_16 AC 146 ms
54,264 KB
testcase_17 AC 143 ms
54,244 KB
testcase_18 AC 148 ms
54,304 KB
testcase_19 AC 145 ms
54,236 KB
testcase_20 AC 149 ms
54,368 KB
testcase_21 AC 157 ms
54,168 KB
testcase_22 AC 146 ms
54,448 KB
testcase_23 AC 144 ms
54,304 KB
testcase_24 AC 141 ms
54,240 KB
testcase_25 AC 152 ms
53,984 KB
testcase_26 AC 129 ms
54,108 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