結果
問題 |
No.216 FAC
|
ユーザー |
|
提出日時 | 2018-01-22 19:33:37 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 874 bytes |
コンパイル時間 | 4,168 ms |
コンパイル使用メモリ | 76,408 KB |
実行使用メモリ | 37,000 KB |
最終ジャッジ日時 | 2024-12-26 01:16:57 |
合計ジャッジ時間 | 6,910 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 WA * 2 |
ソースコード
package me.yukicoder.lv1; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class No0216 { public static void main(String[] args) { try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) { int cnt = Integer.parseInt(br.readLine()); String[] a = br.readLine().split(" "); String[] b = br.readLine().split(" "); int[] score = new int[100]; int scoreK = 0; int max = 0; for (int i = 0; i < cnt; i++) { int tmp = Integer.parseInt(a[i]); int cntSolved = Integer.parseInt(b[i]); if (cntSolved == 0) { scoreK += tmp; } else { score[cntSolved - 1] = tmp; } } for (int i = 0; i < 100; i++) { max = Math.max(max, score[i]); } System.out.println(max <= scoreK ? "YES" : "NO"); } catch (IOException e) { e.printStackTrace(); } } }