結果
問題 | No.586 ダブルブッキング |
ユーザー | akitsugu777 |
提出日時 | 2018-10-12 12:48:35 |
言語 | Python3 (3.11.6 + numpy 1.26.0 + scipy 1.11.3) |
結果 |
AC
|
実行時間 | 17 ms / 2,000 ms |
コード長 | 261 bytes |
コンパイル時間 | 138 ms |
コンパイル使用メモリ | 10,540 KB |
実行使用メモリ | 7,932 KB |
最終ジャッジ日時 | 2023-08-02 19:43:24 |
合計ジャッジ時間 | 955 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge12 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 15 ms
7,756 KB |
testcase_01 | AC | 16 ms
7,884 KB |
testcase_02 | AC | 16 ms
7,788 KB |
testcase_03 | AC | 15 ms
7,932 KB |
testcase_04 | AC | 16 ms
7,892 KB |
testcase_05 | AC | 17 ms
7,928 KB |
testcase_06 | AC | 16 ms
7,728 KB |
testcase_07 | AC | 16 ms
7,800 KB |
ソースコード
p1 = int(input()) p2 = int(input()) n = int(input()) r = [int(input()) for _ in range(n)] cnt = {} for i in r: if i in cnt: cnt[i] += 1 else: cnt[i] = 1 c = 0 for i in cnt: if cnt[i] > 1: c += (p1+p2) * (cnt[i]-1) print(c)