結果

問題 No.1517 Party Location
ユーザー marroncastlemarroncastle
提出日時 2021-05-28 20:29:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 77 ms / 2,000 ms
コード長 171 bytes
コンパイル時間 628 ms
コンパイル使用メモリ 86,324 KB
実行使用メモリ 75,428 KB
最終ジャッジ日時 2023-09-02 04:08:02
合計ジャッジ時間 2,401 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,080 KB
testcase_01 AC 71 ms
70,788 KB
testcase_02 AC 77 ms
75,164 KB
testcase_03 AC 74 ms
75,344 KB
testcase_04 AC 74 ms
75,036 KB
testcase_05 AC 74 ms
75,128 KB
testcase_06 AC 73 ms
75,284 KB
testcase_07 AC 70 ms
70,976 KB
testcase_08 AC 73 ms
75,184 KB
testcase_09 AC 73 ms
75,388 KB
testcase_10 AC 73 ms
75,416 KB
testcase_11 AC 73 ms
75,300 KB
testcase_12 AC 70 ms
71,104 KB
testcase_13 AC 74 ms
75,428 KB
testcase_14 AC 74 ms
75,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

d = int(input())
a, b = map(int, input().split())
min_cost = float('inf')
for x in range(d+1):
  cost = x * a + (d-x) * b
  min_cost = min(min_cost, cost)
print(min_cost)
0