結果
| 問題 | No.216 FAC |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-04-18 18:12:52 |
| 言語 | Python3 (3.14.3 + numpy 2.4.2 + scipy 1.17.0) |
| 結果 |
AC
|
| 実行時間 | 98 ms / 1,000 ms |
| コード長 | 440 bytes |
| 記録 | |
| コンパイル時間 | 592 ms |
| コンパイル使用メモリ | 20,824 KB |
| 実行使用メモリ | 15,360 KB |
| 最終ジャッジ日時 | 2026-03-14 10:35:46 |
| 合計ジャッジ時間 | 3,810 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
ソースコード
#python 3.5.2
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
Scores = {}
for i, a in enumerate(A):
if B[i] in Scores.keys():
Scores[B[i]] += a
else:
Scores[B[i]] = a
res = sorted(Scores.items(), key=lambda x: x[1])
maxScore = res[-1][1]
if not 0 in Scores.keys():
print("NO")
else:
if Scores[0] == maxScore:
print("YES")
else:
print("NO")