結果

問題 No.586 ダブルブッキング
ユーザー en-r
提出日時 2017-11-16 10:28:07
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 29 ms / 2,000 ms
コード長 482 bytes
コンパイル時間 153 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-11-25 06:13:55
合計ジャッジ時間 823 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

Yukiprice = int(input())
otherprice = int(input())
N = int(input())
room_numbers = []
deadcount = 0


for i in range(N):
    room_numbers.append(int(input())) 
    
#リスト内を昇順ソート
room_numbers.sort()
#print(room_numbers)

#n = n+1 なら損出計算
n = 0
for i in range(N-1):
    if room_numbers[n] == room_numbers[n+1]:
        deadcount += 1
    n += 1
        
#損出の合算

lose_sum = deadcount*(Yukiprice + otherprice)

#print(deadcount)
print(lose_sum)
0