結果

問題 No.604 誕生日のお小遣い
ユーザー tails1434tails1434
提出日時 2020-02-18 07:23:13
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 72 ms / 1,000 ms
コード長 380 bytes
コンパイル時間 973 ms
コンパイル使用メモリ 86,984 KB
実行使用メモリ 71,444 KB
最終ジャッジ日時 2023-08-14 01:38:15
合計ジャッジ時間 3,488 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,232 KB
testcase_01 AC 71 ms
71,276 KB
testcase_02 AC 70 ms
71,256 KB
testcase_03 AC 70 ms
71,152 KB
testcase_04 AC 69 ms
71,300 KB
testcase_05 AC 69 ms
71,400 KB
testcase_06 AC 69 ms
71,296 KB
testcase_07 AC 70 ms
71,292 KB
testcase_08 AC 70 ms
70,984 KB
testcase_09 AC 70 ms
71,408 KB
testcase_10 AC 70 ms
71,128 KB
testcase_11 AC 70 ms
71,240 KB
testcase_12 AC 69 ms
71,444 KB
testcase_13 AC 70 ms
71,324 KB
testcase_14 AC 70 ms
71,344 KB
testcase_15 AC 69 ms
70,984 KB
testcase_16 AC 68 ms
71,436 KB
testcase_17 AC 69 ms
71,260 KB
testcase_18 AC 70 ms
71,280 KB
testcase_19 AC 71 ms
71,324 KB
testcase_20 AC 69 ms
71,236 KB
testcase_21 AC 70 ms
70,944 KB
testcase_22 AC 70 ms
71,144 KB
testcase_23 AC 70 ms
71,264 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

A, B, C = map(int, input().split())

def check(x):
    money = 0
    mul = x // A
    money += B * mul
    money += (x - mul)
    return money >= C

def main():
    ok = 10 ** 18
    ng = 0
    while abs(ok - ng) > 1:
        mid = (ok + ng) // 2
        if check(mid):
            ok = mid
        else:
            ng = mid

    print(ok)


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