結果

問題 No.216 FAC
ユーザー kenji_shioyakenji_shioya
提出日時 2016-06-11 06:53:20
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 681 bytes
コンパイル時間 2,801 ms
コンパイル使用メモリ 74,672 KB
実行使用メモリ 56,716 KB
最終ジャッジ日時 2024-04-17 18:42:12
合計ジャッジ時間 6,790 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 90 ms
41,780 KB
testcase_01 AC 96 ms
41,308 KB
testcase_02 AC 95 ms
41,488 KB
testcase_03 AC 119 ms
41,860 KB
testcase_04 AC 113 ms
41,524 KB
testcase_05 AC 101 ms
41,520 KB
testcase_06 AC 103 ms
41,408 KB
testcase_07 AC 104 ms
41,536 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 110 ms
39,928 KB
testcase_12 WA -
testcase_13 AC 106 ms
41,276 KB
testcase_14 WA -
testcase_15 AC 105 ms
41,552 KB
testcase_16 AC 118 ms
41,856 KB
testcase_17 AC 115 ms
41,812 KB
testcase_18 WA -
testcase_19 AC 118 ms
41,544 KB
testcase_20 WA -
testcase_21 AC 117 ms
41,788 KB
testcase_22 AC 113 ms
41,664 KB
testcase_23 AC 113 ms
41,396 KB
testcase_24 WA -
testcase_25 AC 117 ms
41,528 KB
testcase_26 AC 110 ms
41,520 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 othersScore = 0;
    int ksScore = 0;


    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++){
      if(solved[j] == 0){
        ksScore += scores[j];
      }else{
        othersScore += scores[j];
      }
    }

    if(ksScore < othersScore){
      System.out.println("NO");
    }else{
      System.out.println("YES");
    }
  }
}
0