結果

問題 No.1517 Party Location
ユーザー ygd.ygd.
提出日時 2021-05-28 22:08:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 74 ms / 2,000 ms
コード長 286 bytes
コンパイル時間 336 ms
コンパイル使用メモリ 86,988 KB
実行使用メモリ 75,512 KB
最終ジャッジ日時 2023-09-02 04:12:30
合計ジャッジ時間 2,270 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
71,068 KB
testcase_01 AC 65 ms
71,172 KB
testcase_02 AC 69 ms
75,412 KB
testcase_03 AC 69 ms
75,392 KB
testcase_04 AC 74 ms
75,240 KB
testcase_05 AC 72 ms
75,440 KB
testcase_06 AC 71 ms
75,424 KB
testcase_07 AC 67 ms
71,356 KB
testcase_08 AC 71 ms
75,216 KB
testcase_09 AC 72 ms
75,324 KB
testcase_10 AC 69 ms
75,512 KB
testcase_11 AC 68 ms
75,424 KB
testcase_12 AC 67 ms
70,964 KB
testcase_13 AC 70 ms
75,384 KB
testcase_14 AC 68 ms
75,404 KB
権限があれば一括ダウンロードができます

ソースコード

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