結果

問題 No.216 FAC
ユーザー turner18_jp
提出日時 2017-12-08 21:42:43
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 371 bytes
コンパイル時間 210 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-11-29 19:47:46
合計ジャッジ時間 1,960 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
score = list(map(int, input().split()))
player = list(map(int, input().split()))
current = {}
for i in range(110):
  current[str(i)] = 0

for i, v in enumerate(player):
  current[str(v)] += score[i]

k = current['0']

def judge(k, current):
  for i in range(1, n):
    if current[str(i)] > k:
      return 'NO'
  
  return 'YES'

print(judge(k, current))
0