結果

問題 No.1350 2019-6problem
コンテスト
ユーザー 👑 rin204
提出日時 2022-01-18 18:43:09
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 24 ms / 2,000 ms
+ 88µs
コード長 262 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 63 ms
コンパイル使用メモリ 82,020 KB
実行使用メモリ 56,144 KB
最終ジャッジ日時 2026-09-28 15:19:32
合計ジャッジ時間 2,611 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from math import gcd

a, b, k = map(int, input().split())
lc = a * b // gcd(a, b)

def cnt(x):
    return x // a + x // b - x // lc

l = 1
r = a * k
while r - l > 1:
    mid = (r + l) // 2
    if cnt(mid) >= k:
        r = mid
    else:
        l = mid
print(r)
0