結果
問題 | No.2526 Kth Not-divisible Number |
ユーザー |
|
提出日時 | 2023-11-08 04:46:52 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 530 bytes |
コンパイル時間 | 271 ms |
コンパイル使用メモリ | 82,332 KB |
実行使用メモリ | 88,052 KB |
最終ジャッジ日時 | 2024-09-25 23:35:40 |
合計ジャッジ時間 | 4,396 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 56 ms
61,312 KB |
testcase_01 | AC | 47 ms
55,168 KB |
testcase_02 | AC | 49 ms
55,552 KB |
testcase_03 | TLE | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
ソースコード
from collections import * from functools import * from itertools import * from heapq import * import sys,math input = sys.stdin.buffer.readline def answer(): A,B,K = map(int,input().split()) def is_ok(x): tmp = (x//A) + (x//B) - (x//(A*B//math.gcd(A,B))) return x-tmp >= K y = K*(A*B) x = K-1 while y-x>1: mid = (y+x)//2 if is_ok(mid): y = mid else: x = mid print(y) for _ in range(int(input())): answer()