結果
| 問題 |
No.2526 Kth Not-divisible Number
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-11-28 18:44:42 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 326 bytes |
| コンパイル時間 | 303 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 16,256 KB |
| 最終ジャッジ日時 | 2024-09-26 13:02:31 |
| 合計ジャッジ時間 | 4,205 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 2 TLE * 1 -- * 8 |
ソースコード
from math import lcm
def is_ok(md):
cnt = md - md//A - md//B + md//L
return cnt >= K
def bis(ok, ng):
while abs(ok - ng) > 1:
md = (ng + ok) // 2
if is_ok(md): ok = md
else: ng = md
return ok
for _ in range(T := int(input())):
A, B, K = map(int, input().split())
L = lcm(A, B)
print(bis(10**19, 0))