結果

問題 No.1350 2019-6problem
ユーザー tktk_snsntktk_snsn
提出日時 2021-01-17 13:15:00
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 72 ms / 2,000 ms
コード長 258 bytes
コンパイル時間 1,237 ms
コンパイル使用メモリ 86,800 KB
実行使用メモリ 71,596 KB
最終ジャッジ日時 2023-08-19 18:50:36
合計ジャッジ時間 3,352 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,112 KB
testcase_01 AC 71 ms
71,168 KB
testcase_02 AC 72 ms
71,456 KB
testcase_03 AC 72 ms
71,452 KB
testcase_04 AC 70 ms
71,184 KB
testcase_05 AC 70 ms
71,376 KB
testcase_06 AC 72 ms
71,084 KB
testcase_07 AC 70 ms
71,300 KB
testcase_08 AC 70 ms
71,248 KB
testcase_09 AC 71 ms
71,308 KB
testcase_10 AC 70 ms
71,596 KB
testcase_11 AC 72 ms
71,408 KB
testcase_12 AC 71 ms
71,348 KB
testcase_13 AC 72 ms
71,452 KB
testcase_14 AC 72 ms
71,164 KB
testcase_15 AC 72 ms
71,304 KB
testcase_16 AC 71 ms
71,400 KB
testcase_17 AC 70 ms
71,168 KB
testcase_18 AC 69 ms
71,420 KB
testcase_19 AC 68 ms
71,276 KB
testcase_20 AC 70 ms
71,404 KB
testcase_21 AC 69 ms
71,112 KB
testcase_22 AC 70 ms
71,012 KB
testcase_23 AC 71 ms
71,452 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd
A, B, K = map(int, input().split())
lcm = A * (B // gcd(A, B))


def enum(x):
    return x//A + x//B - x//lcm


l = 0
r = 10 ** 20
while r - l > 1:
    m = (l + r) // 2
    if enum(m) >= K:
        r = m
    else:
        l = m

print(r)
0