結果

問題 No.604 誕生日のお小遣い
コンテスト
ユーザー me
提出日時 2024-12-20 19:44:50
言語 Python3
(3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 26 ms / 1,000 ms
+ 574µs
コード長 293 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 66 ms
コンパイル使用メモリ 15,104 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2026-10-13 13:15:25
合計ジャッジ時間 2,724 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

def check(a, b, c):
    ng, ok = 0, c
    while ok - ng > 1:
        mid = (ng + ok) // 2
        total = mid // a * b + mid - mid // a
        if total >= c:
            ok = mid
        else:
            ng = mid

    return ok
    
a, b, c = map(int, input().split())

print(check(a, b, c))
0