結果

問題 No.1350 2019-6problem
ユーザー O2MTO2MT
提出日時 2021-02-16 18:49:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 70 ms / 2,000 ms
コード長 217 bytes
コンパイル時間 514 ms
コンパイル使用メモリ 87,084 KB
実行使用メモリ 71,748 KB
最終ジャッジ日時 2023-10-11 09:15:08
合計ジャッジ時間 3,344 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,356 KB
testcase_01 AC 65 ms
71,464 KB
testcase_02 AC 68 ms
71,588 KB
testcase_03 AC 68 ms
71,420 KB
testcase_04 AC 70 ms
71,420 KB
testcase_05 AC 65 ms
71,196 KB
testcase_06 AC 66 ms
71,196 KB
testcase_07 AC 67 ms
71,520 KB
testcase_08 AC 65 ms
71,748 KB
testcase_09 AC 64 ms
71,200 KB
testcase_10 AC 67 ms
71,548 KB
testcase_11 AC 67 ms
71,196 KB
testcase_12 AC 66 ms
71,212 KB
testcase_13 AC 68 ms
71,336 KB
testcase_14 AC 65 ms
71,524 KB
testcase_15 AC 68 ms
71,524 KB
testcase_16 AC 69 ms
71,528 KB
testcase_17 AC 69 ms
71,584 KB
testcase_18 AC 68 ms
71,464 KB
testcase_19 AC 65 ms
71,748 KB
testcase_20 AC 68 ms
71,472 KB
testcase_21 AC 67 ms
71,544 KB
testcase_22 AC 66 ms
71,720 KB
testcase_23 AC 68 ms
71,368 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd
A,B,K = map(int,input().split())
lcm = (A*B)//gcd(A,B)
l = 1
r = A*B*K
while abs(r-l) > 1:
    mid = (l+r)//2
    if mid//A+mid//B-mid//lcm >= K:
        r = mid
    else:
        l = mid
print(r)
0