結果

問題 No.586 ダブルブッキング
ユーザー GrayCoderGrayCoder
提出日時 2017-11-03 22:38:20
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 16 ms / 2,000 ms
コード長 320 bytes
コンパイル時間 324 ms
コンパイル使用メモリ 10,676 KB
実行使用メモリ 7,996 KB
最終ジャッジ日時 2023-08-14 17:01:11
合計ジャッジ時間 771 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,996 KB
testcase_01 AC 16 ms
7,860 KB
testcase_02 AC 15 ms
7,864 KB
testcase_03 AC 16 ms
7,784 KB
testcase_04 AC 15 ms
7,840 KB
testcase_05 AC 15 ms
7,840 KB
testcase_06 AC 16 ms
7,840 KB
testcase_07 AC 15 ms
7,804 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    P1, P2, N = (int(input()) for _ in [0] * 3)
    R = tuple(int(input()) for _ in [0] * N)

    room = dict()
    for i in R:
        room[i] = room.get(i, 0) + 1

    loss = 0
    for v in room.values():
        if v > 1:
            n = v - 1
            loss += P1 * n + P2 * n

    print(loss)

main()
0