結果

問題 No.1517 Party Location
ユーザー けむけむ
提出日時 2021-06-10 17:39:38
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 29 ms / 2,000 ms
コード長 301 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2024-06-11 11:15:04
合計ジャッジ時間 1,058 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

def f_cost(d, a, b):
    cost_list = []
    for x in range(d + 1):
        cost = x * a + (d - x) * b
        cost_list.append(cost)
    return min(cost_list)

if __name__ == '__main__':
    d = input()
    d = int(d)
    a, b = map(int, input().split())
    result = f_cost(d, a, b)
    print(result)
0