結果
| 問題 |
No.216 FAC
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-09-05 09:40:41 |
| 言語 | Python2 (2.7.18) |
| 結果 |
AC
|
| 実行時間 | 13 ms / 1,000 ms |
| コード長 | 236 bytes |
| コンパイル時間 | 105 ms |
| コンパイル使用メモリ | 7,040 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2024-11-15 20:22:03 |
| 合計ジャッジ時間 | 1,465 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
ソースコード
N = input()
a = map(int, raw_input().split())
b = map(int, raw_input().split())
c = {0:0}
for i in xrange(N):
if b[i] in c:
c[b[i]] += a[i]
else:
c[b[i]] = a[i]
print 'YES' if max(c.values()) <= c[0] else 'NO'