結果

問題 No.216 FAC
コンテスト
ユーザー boya978
提出日時 2019-09-05 04:22:36
言語 Python3
(3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
RE  
実行時間 -
コード長 383 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 541 ms
コンパイル使用メモリ 14,976 KB
実行使用メモリ 13,440 KB
最終ジャッジ日時 2026-10-09 19:08:07
合計ジャッジ時間 2,674 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14 WA * 5 RE * 5
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n=int(input())
scores = list(map(int,input().split()))
winners = input().split()
dict = {}

for i in range(n):
    if not winners[i] in dict:
        dict[winners[i]] = scores[i]
    else:
        dict[winners[i]] += scores[i]

K = dict["0"]
rank=[]
for key,value in dict.items():
    rank.append(value)

rank.reverse()

if K >= rank[0]:
    print("YES")
else:
    print("NO")
    

0