結果

問題 No.176 2種類の切手
ユーザー yn
提出日時 2015-09-01 12:48:16
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 272 bytes
コンパイル時間 85 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 103,204 KB
最終ジャッジ日時 2024-10-08 03:32:02
合計ジャッジ時間 3,628 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 14 WA * 4 TLE * 1 -- * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

a, b, t = map(int,input().split())
# a円の切手x枚, b円の切手y枚
y = 0
ans = []
while True:
    x = (t - b * y) // a
    if (t - b * y) % a != 0:
        x += 1
    ans.append(a * x + b * y)

    if b * y > t :
        break

    y += 1

ans.sort()

print(ans[0])
0