結果

問題 No.176 2種類の切手
ユーザー e-mon
提出日時 2015-04-03 23:02:25
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 46 ms / 1,000 ms
コード長 246 bytes
コンパイル時間 86 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-10-08 03:06:37
合計ジャッジ時間 2,075 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python
# -*- coding: utf-8 -*-

A,B,T = map(int,input().split())
ans = 10**10

for i in range(A):
    x = max(((T-B*i)+A-1)//A,0)
    if abs(T-ans) > abs(T-A*x-B*i):
        ans = A*x + B*i
    if B*i > T:
        break
print(ans)
0