結果

問題 No.586 ダブルブッキング
ユーザー Meso Meso
提出日時 2024-05-03 19:27:06
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 28 ms / 2,000 ms
コード長 271 bytes
コンパイル時間 189 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-11-24 23:09:25
合計ジャッジ時間 1,151 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

e = int(input())
l = int(input())

dic = {}
n = int(input())

for i in range(n):
    r = int(input())
    if r in dic:
        dic[r] += 1
    else:
        dic[r]= 1

loss = 0
for v in dic.values():
    if v >= 2:
        loss += (e * (v - 1) + l * (v - 1))

print(loss)
0