結果

問題 No.216 FAC
ユーザー zombietanzombietan
提出日時 2016-05-04 05:48:07
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 31 ms / 1,000 ms
コード長 341 bytes
コンパイル時間 82 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-10-15 00:58:21
合計ジャッジ時間 1,610 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
score = [int(x) for x in input().split()]
num = [y for y in input().split()]
pp = {i:0 for i in set(num)}

for i, s in zip(num, score):
    pp[i] += s

kscore = 0
mscore = 0
for k, v in pp.items():
    if k == '0':
        kscore = v
    elif mscore < v:
        mscore = v

print('YES') if kscore >= mscore else print('NO')
0