結果

問題 No.2138 Add Bacon
ユーザー u_kunu_kun
提出日時 2022-12-02 14:33:27
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 313 bytes
コンパイル時間 339 ms
コンパイル使用メモリ 82,036 KB
実行使用メモリ 53,520 KB
最終ジャッジ日時 2024-10-09 16:44:03
合計ジャッジ時間 2,250 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

base_taste, base_cal, max_add_bacon, one_bacon_taste, one_bacon_cal = map(int, input().split())

happy = -10 ** 20

for add_bacon in range(max_add_bacon + 1):
    taste = base_taste + one_bacon_taste * add_bacon
    cal = base_cal + one_bacon_cal * add_bacon
    
    happy = max(taste - cal, happy)

print(happy)
0