結果

問題 No.176 2種類の切手
ユーザー yn
提出日時 2015-09-01 12:59:26
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 291 bytes
コンパイル時間 328 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 96,160 KB
最終ジャッジ日時 2024-10-08 03:32:13
合計ジャッジ時間 3,989 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 WA * 3 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
        
    if b * y > t or x < 0 :
        break
    ans.append(a * x + b * y)

    y += 1

ans.sort()

print(ans[0])
0