結果

問題 No.1517 Party Location
ユーザー ygd.
提出日時 2021-05-28 22:08:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 43 ms / 2,000 ms
コード長 286 bytes
コンパイル時間 143 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 57,600 KB
最終ジャッジ日時 2024-06-11 10:54:59
合計ジャッジ時間 1,358 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys 
input = sys.stdin.buffer.readline
def main():
    d = int(input()); INF = float("inf")
    a,b = map(int,input().split())
    ans = INF
    for x in range(d+1):
        cost = x*a + abs(d-x)*b
        ans = min(ans,cost)
    print(ans)

if __name__ == '__main__':
    main()
0