結果

問題 No.586 ダブルブッキング
ユーザー uu
提出日時 2018-03-03 19:38:42
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 19 ms / 2,000 ms
コード長 299 bytes
コンパイル時間 74 ms
コンパイル使用メモリ 10,592 KB
実行使用メモリ 8,564 KB
最終ジャッジ日時 2023-09-17 04:57:01
合計ジャッジ時間 865 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,448 KB
testcase_01 AC 18 ms
8,436 KB
testcase_02 AC 18 ms
8,452 KB
testcase_03 AC 18 ms
8,504 KB
testcase_04 AC 18 ms
8,456 KB
testcase_05 AC 18 ms
8,564 KB
testcase_06 AC 19 ms
8,436 KB
testcase_07 AC 19 ms
8,452 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter

p1 = int(input())
p2 = int(input())
N = int(input())
room_no = [input() for i in range(N)]
count = Counter(room_no)

lost_sum = []

for k,v in count.items():
    if count[k] != 1:
        lost = (v - 1) * (p1 + p2)
        lost_sum.append(lost)

print(sum(lost_sum))
0