結果
| 問題 | No.586 ダブルブッキング | 
| コンテスト | |
| ユーザー |  Liny52551272 | 
| 提出日時 | 2019-11-13 13:36:06 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 32 ms / 2,000 ms | 
| コード長 | 299 bytes | 
| コンパイル時間 | 163 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 10,752 KB | 
| 最終ジャッジ日時 | 2024-09-21 21:07:13 | 
| 合計ジャッジ時間 | 953 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 5 | 
ソースコード
P1 = int(input().strip())
P2 = int(input().strip())
N = int(input().strip())
lst1 = []
lst2 = []
for i in range(N):
  R = input().strip()
  try:
    tmp = lst1.index(R)
    lst2[tmp] += 1
  except:
    lst1.append(R)
    lst2.append(1)
print((sum(lst2) - len(lst2)) * (P1 + P2))
            
            
            
        