結果

問題 No.1350 2019-6problem
ユーザー marroncastlemarroncastle
提出日時 2021-01-20 22:25:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 77 ms / 2,000 ms
コード長 337 bytes
コンパイル時間 425 ms
コンパイル使用メモリ 87,112 KB
実行使用メモリ 71,696 KB
最終ジャッジ日時 2023-08-25 02:08:38
合計ジャッジ時間 3,447 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,472 KB
testcase_01 AC 74 ms
71,376 KB
testcase_02 AC 77 ms
71,168 KB
testcase_03 AC 74 ms
71,372 KB
testcase_04 AC 74 ms
71,528 KB
testcase_05 AC 74 ms
71,440 KB
testcase_06 AC 74 ms
71,172 KB
testcase_07 AC 74 ms
71,360 KB
testcase_08 AC 75 ms
71,288 KB
testcase_09 AC 75 ms
71,168 KB
testcase_10 AC 75 ms
71,524 KB
testcase_11 AC 74 ms
71,388 KB
testcase_12 AC 74 ms
71,324 KB
testcase_13 AC 74 ms
71,544 KB
testcase_14 AC 74 ms
71,176 KB
testcase_15 AC 75 ms
71,328 KB
testcase_16 AC 74 ms
71,388 KB
testcase_17 AC 73 ms
71,172 KB
testcase_18 AC 73 ms
71,468 KB
testcase_19 AC 74 ms
71,524 KB
testcase_20 AC 74 ms
71,696 KB
testcase_21 AC 72 ms
71,168 KB
testcase_22 AC 73 ms
71,480 KB
testcase_23 AC 72 ms
71,620 KB
権限があれば一括ダウンロードができます

ソースコード

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