結果

問題 No.604 誕生日のお小遣い
ユーザー 👑 yumechiyumechi
提出日時 2017-12-04 21:03:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 34 ms / 1,000 ms
コード長 403 bytes
コンパイル時間 135 ms
コンパイル使用メモリ 82,008 KB
実行使用メモリ 53,428 KB
最終ジャッジ日時 2024-05-01 14:28:23
合計ジャッジ時間 1,577 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
51,744 KB
testcase_01 AC 34 ms
52,876 KB
testcase_02 AC 34 ms
51,760 KB
testcase_03 AC 34 ms
52,308 KB
testcase_04 AC 32 ms
52,612 KB
testcase_05 AC 32 ms
52,368 KB
testcase_06 AC 33 ms
52,264 KB
testcase_07 AC 32 ms
53,004 KB
testcase_08 AC 31 ms
52,644 KB
testcase_09 AC 32 ms
52,864 KB
testcase_10 AC 33 ms
53,420 KB
testcase_11 AC 31 ms
53,284 KB
testcase_12 AC 32 ms
52,668 KB
testcase_13 AC 32 ms
52,236 KB
testcase_14 AC 32 ms
51,816 KB
testcase_15 AC 32 ms
52,000 KB
testcase_16 AC 32 ms
52,000 KB
testcase_17 AC 31 ms
52,212 KB
testcase_18 AC 32 ms
52,196 KB
testcase_19 AC 33 ms
52,220 KB
testcase_20 AC 32 ms
52,760 KB
testcase_21 AC 33 ms
52,616 KB
testcase_22 AC 33 ms
53,428 KB
testcase_23 AC 32 ms
52,484 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