結果

問題 No.586 ダブルブッキング
ユーザー Liny52551272Liny52551272
提出日時 2019-11-13 13:36:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 31 ms / 2,000 ms
コード長 299 bytes
コンパイル時間 114 ms
コンパイル使用メモリ 11,896 KB
実行使用メモリ 10,028 KB
最終ジャッジ日時 2023-10-21 19:41:51
合計ジャッジ時間 967 ms
ジャッジサーバーID
(参考情報)
judge9 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,028 KB
testcase_01 AC 29 ms
10,028 KB
testcase_02 AC 31 ms
10,028 KB
testcase_03 AC 29 ms
10,028 KB
testcase_04 AC 29 ms
10,028 KB
testcase_05 AC 30 ms
10,028 KB
testcase_06 AC 30 ms
10,028 KB
testcase_07 AC 29 ms
10,028 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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))
0