結果

問題 No.216 FAC
ユーザー Subaru314Subaru314
提出日時 2021-05-24 01:05:35
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 829 bytes
コンパイル時間 2,016 ms
コンパイル使用メモリ 77,728 KB
実行使用メモリ 54,372 KB
最終ジャッジ日時 2024-04-20 10:12:09
合計ジャッジ時間 6,640 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
52,900 KB
testcase_01 AC 127 ms
54,204 KB
testcase_02 AC 129 ms
54,280 KB
testcase_03 AC 141 ms
54,236 KB
testcase_04 AC 138 ms
54,368 KB
testcase_05 AC 136 ms
54,092 KB
testcase_06 AC 124 ms
54,176 KB
testcase_07 AC 112 ms
54,240 KB
testcase_08 AC 129 ms
53,960 KB
testcase_09 AC 133 ms
53,980 KB
testcase_10 AC 131 ms
54,056 KB
testcase_11 AC 131 ms
54,228 KB
testcase_12 AC 129 ms
54,204 KB
testcase_13 AC 129 ms
53,992 KB
testcase_14 AC 123 ms
52,992 KB
testcase_15 WA -
testcase_16 AC 141 ms
54,100 KB
testcase_17 AC 144 ms
53,932 KB
testcase_18 AC 144 ms
54,264 KB
testcase_19 AC 140 ms
54,064 KB
testcase_20 AC 142 ms
54,328 KB
testcase_21 AC 159 ms
54,124 KB
testcase_22 AC 147 ms
54,088 KB
testcase_23 AC 146 ms
53,988 KB
testcase_24 AC 146 ms
54,248 KB
testcase_25 AC 142 ms
54,372 KB
testcase_26 AC 130 ms
54,104 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] pro = new int[n];
    int[] name = new int[n];
    for(int i = 0; i < n; i++){
      pro[i] = sc.nextInt();
    }
    for(int i = 0; i < n; i++){
      name[i] = sc.nextInt();
    }
    int[] point = new int[100];
    for(int i = 0; i < 100; i++){
      point[i] = 100;
    }
    for(int i = 0; i < 100; i++){
      for(int j = 0; j < n; j++){
        if(name[j] == i){
          point[i] = point[i] + pro[j];
        }
      }
    }
    int ans = point[0];
    for(int i = 1; i < 100; i++){
      if(ans<point[i]){
        ans = point[i];
      }
    }
    if(ans==point[0]){
      System.out.println("YES");
    }else{
      System.out.println("NO");
    }
  }
}
0