結果

問題 No.1453 手助け
ユーザー lam6er
提出日時 2025-03-20 21:08:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 43 ms / 2,000 ms
コード長 459 bytes
コンパイル時間 152 ms
コンパイル使用メモリ 82,608 KB
実行使用メモリ 59,648 KB
最終ジャッジ日時 2025-03-20 21:08:48
合計ジャッジ時間 1,843 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

A, B, C, D, E = map(int, input().split())
total = A * (B - C)

if total == 0:
    print(0)
else:
    total_cost = 0
    current_price = D
    total_cost += current_price

    for i in range(2, total + 1):
        if i % 10 == 0:
            if current_price >= E:
                current_price -= E
            # else, remains the same as before
        # Update the total cost with the current price
        total_cost += current_price

    print(total_cost)
0