結果

問題 No.2526 Kth Not-divisible Number
ユーザー nikoro256nikoro256
提出日時 2023-11-03 21:47:20
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 354 bytes
コンパイル時間 145 ms
コンパイル使用メモリ 81,844 KB
実行使用メモリ 82,136 KB
最終ジャッジ日時 2023-11-03 21:47:46
合計ジャッジ時間 10,331 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,784 KB
testcase_01 AC 42 ms
53,784 KB
testcase_02 AC 40 ms
53,784 KB
testcase_03 TLE -
testcase_04 TLE -
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
def isok(n):
    ans=n-n//A-n//B+n//math.lcm(A,B)
    if ans<K:
        return True
    return False

T=int(input())
for _ in range(T):
    A,B,K=map(int,input().split())
    left,right=0,10**20
    while right-left>1:
        mid=(right+left)//2
        if isok(mid):
            left=mid
        else:
            right=mid
    print(right)
0