結果

問題 No.216 FAC
ユーザー kenji_shioyakenji_shioya
提出日時 2016-06-11 07:09:40
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 750 bytes
コンパイル時間 3,737 ms
コンパイル使用メモリ 75,200 KB
実行使用メモリ 56,416 KB
最終ジャッジ日時 2024-04-17 18:42:42
合計ジャッジ時間 8,552 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
41,536 KB
testcase_01 AC 136 ms
41,244 KB
testcase_02 AC 135 ms
41,380 KB
testcase_03 AC 149 ms
41,580 KB
testcase_04 AC 143 ms
41,676 KB
testcase_05 AC 126 ms
40,212 KB
testcase_06 AC 133 ms
41,840 KB
testcase_07 WA -
testcase_08 AC 135 ms
41,432 KB
testcase_09 AC 133 ms
41,288 KB
testcase_10 AC 133 ms
41,540 KB
testcase_11 AC 135 ms
41,772 KB
testcase_12 AC 137 ms
41,392 KB
testcase_13 AC 136 ms
41,280 KB
testcase_14 AC 138 ms
41,416 KB
testcase_15 AC 134 ms
41,152 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 148 ms
41,408 KB
testcase_19 WA -
testcase_20 AC 159 ms
41,820 KB
testcase_21 AC 148 ms
41,652 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 153 ms
42,004 KB
testcase_25 WA -
testcase_26 AC 134 ms
41,260 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Exercise76{
  public static void main (String[] args){

    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();
    int[] scores = new int[n];
    int[] solved = new int[n];

    int[] pp = new int[101];


    for (int i = 0; i < n; i++){
      scores[i] = sc.nextInt();
    }
    for (int i = 0; i < n; i++){
      solved[i] = sc.nextInt();
    }

    for (int j = 0; j < n; j++){
      pp[solved[j]] += scores[j];
    }

    boolean flag = false;
    for (int j = 1; j < pp.length; j++){
      if (pp[j] == 0){
        continue;
      }
      if (pp[0] >= pp[j]){
        flag = true;
      }
    }

    if (flag){
      System.out.println("YES");
    }else{
      System.out.println("NO");
    }
  }
}
0