結果
問題 |
No.216 FAC
|
ユーザー |
![]() |
提出日時 | 2025-03-20 21:01:39 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 37 ms / 1,000 ms |
コード長 | 418 bytes |
コンパイル時間 | 337 ms |
コンパイル使用メモリ | 82,244 KB |
実行使用メモリ | 54,020 KB |
最終ジャッジ日時 | 2025-03-20 21:01:44 |
合計ジャッジ時間 | 2,002 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
n = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) k_score = 0 participants = [0] * 100 # Participants 1-100 correspond to indexes 0-99 for i in range(n): if b[i] == 0: k_score += a[i] else: p_index = b[i] - 1 # Convert to 0-based index participants[p_index] += a[i] max_other = max(participants) print("YES" if k_score >= max_other else "NO")