結果

問題 No.216 FAC
ユーザー HIROPON87069639
提出日時 2016-02-27 15:50:47
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 284 bytes
コンパイル時間 206 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-24 11:39:44
合計ジャッジ時間 1,179 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
N = input()
A = map(int, raw_input().split())
B = map(int, raw_input().split())
P = [0] * 101
for i in range(0, N):
    if B[i] == 0:
        P[100] += A[i]
    else:
        P[B[i]] += A[i]
maxP = max(P)
if maxP == P[100]:
    print "YES"
else:
    print "NO"
0