結果
| 問題 | No.216 FAC |
| コンテスト | |
| ユーザー |
togatoga
|
| 提出日時 | 2015-08-17 09:06:22 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 85 ms / 1,000 ms |
| コード長 | 272 bytes |
| 記録 | |
| コンパイル時間 | 122 ms |
| コンパイル使用メモリ | 77,812 KB |
| 最終ジャッジ日時 | 2025-12-03 16:16:07 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
ソースコード
N = input()
a = map(int, raw_input().split())
b = map(int, raw_input().split())
score = 0
other = [0] * (101)
for i in range(N):
if (b[i] == 0):
score += a[i]
else:
other[b[i]] += a[i]
if (score >= max(other)):
print "YES"
else:
print "NO"
togatoga