結果

問題 No.1350 2019-6problem
ユーザー MitarushiMitarushi
提出日時 2021-01-17 14:34:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 224 bytes
コンパイル時間 280 ms
コンパイル使用メモリ 82,356 KB
実行使用メモリ 53,944 KB
最終ジャッジ日時 2024-05-07 03:32:10
合計ジャッジ時間 1,968 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
52,892 KB
testcase_01 AC 36 ms
53,496 KB
testcase_02 AC 35 ms
52,500 KB
testcase_03 AC 36 ms
53,812 KB
testcase_04 AC 35 ms
53,440 KB
testcase_05 AC 37 ms
52,700 KB
testcase_06 AC 35 ms
53,944 KB
testcase_07 AC 36 ms
52,528 KB
testcase_08 AC 39 ms
52,888 KB
testcase_09 AC 35 ms
52,772 KB
testcase_10 AC 36 ms
52,432 KB
testcase_11 AC 38 ms
52,868 KB
testcase_12 AC 37 ms
53,116 KB
testcase_13 AC 36 ms
53,244 KB
testcase_14 AC 36 ms
51,956 KB
testcase_15 AC 36 ms
53,264 KB
testcase_16 AC 37 ms
53,568 KB
testcase_17 AC 36 ms
53,212 KB
testcase_18 AC 37 ms
52,880 KB
testcase_19 AC 35 ms
52,660 KB
testcase_20 AC 35 ms
52,616 KB
testcase_21 AC 36 ms
53,112 KB
testcase_22 AC 36 ms
52,780 KB
testcase_23 AC 38 ms
52,700 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd
a,b,k = map(int, input().split())
c = a*b // gcd(a,b)
ng = 0
ok = 10**18
while abs(ok-ng) > 1:
    m = (ok+ng) // 2
    s = m//a+m//b-m//c
    if s >= k:
        ok = m
    else:
        ng = m
print(ok)
0