結果

問題 No.1350 2019-6problem
ユーザー marroncastle
提出日時 2021-01-20 22:25:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 38 ms / 2,000 ms
コード長 337 bytes
コンパイル時間 282 ms
コンパイル使用メモリ 82,144 KB
実行使用メモリ 54,056 KB
最終ジャッジ日時 2024-12-23 14:11:28
合計ジャッジ時間 1,941 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

def check(target):
  cnt = target//A + target//B - target//(A*B//g)
  if cnt<K:
    return False
  return True

from math import gcd
A, B, K = map(int, input().split())
g = gcd(A,B)
low,high = 0,10**18
mid = (low+high)//2
while high-low>1:
  if check(mid):
    high = mid
  else:
    low = mid
  mid = (low+high)//2
ans = high
print(ans)
0