結果

問題 No.1350 2019-6problem
ユーザー NoaSaber
提出日時 2021-04-04 09:08:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 53 ms / 2,000 ms
コード長 321 bytes
コンパイル時間 447 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 51,968 KB
最終ジャッジ日時 2024-12-26 13:25:33
合計ジャッジ時間 2,796 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

A,B,K=map(int,input().split())
import math
com=A*B//math.gcd(A,B)
def is_ok(arg):
    return arg//A+arg//B-arg//com>=K
def m_bisect(ng, ok):
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if is_ok(mid):
            ok = mid
        else:
            ng = mid
    return ok
print(m_bisect(0,10**18+1))
0