結果

問題 No.604 誕生日のお小遣い
ユーザー 👑 yumechiyumechi
提出日時 2017-12-04 21:03:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 66 ms / 1,000 ms
コード長 403 bytes
コンパイル時間 697 ms
コンパイル使用メモリ 86,992 KB
実行使用メモリ 71,512 KB
最終ジャッジ日時 2023-08-14 01:25:24
合計ジャッジ時間 3,119 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
71,364 KB
testcase_01 AC 59 ms
71,316 KB
testcase_02 AC 62 ms
71,280 KB
testcase_03 AC 60 ms
71,352 KB
testcase_04 AC 60 ms
71,296 KB
testcase_05 AC 61 ms
71,276 KB
testcase_06 AC 61 ms
71,512 KB
testcase_07 AC 61 ms
71,360 KB
testcase_08 AC 60 ms
71,368 KB
testcase_09 AC 61 ms
71,508 KB
testcase_10 AC 57 ms
71,400 KB
testcase_11 AC 60 ms
71,064 KB
testcase_12 AC 62 ms
71,328 KB
testcase_13 AC 61 ms
71,388 KB
testcase_14 AC 65 ms
71,264 KB
testcase_15 AC 66 ms
71,176 KB
testcase_16 AC 60 ms
71,068 KB
testcase_17 AC 63 ms
71,388 KB
testcase_18 AC 62 ms
71,244 KB
testcase_19 AC 61 ms
71,180 KB
testcase_20 AC 61 ms
71,428 KB
testcase_21 AC 59 ms
71,176 KB
testcase_22 AC 61 ms
71,364 KB
testcase_23 AC 61 ms
71,304 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

def solve():
    a, b, c = map(int, input().split())
    high, low = 10 ** 18, 1
    for _ in range(100):
        mid = (high + low) // 2
        money = b * (mid // a) + 1 * (mid - mid // a)
        if money < c:
            low = mid
        else:
            high = mid
    # print([low, mid, high])
    print(high)

if __name__=="__main__":
    solve()
0