結果
問題 | No.2526 Kth Not-divisible Number |
ユーザー | naesira |
提出日時 | 2023-11-03 23:53:33 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 304 bytes |
コンパイル時間 | 193 ms |
コンパイル使用メモリ | 81,804 KB |
実行使用メモリ | 77,612 KB |
最終ジャッジ日時 | 2023-11-03 23:53:57 |
合計ジャッジ時間 | 21,514 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 32 ms
53,552 KB |
testcase_01 | AC | 31 ms
53,552 KB |
testcase_02 | AC | 30 ms
53,552 KB |
testcase_03 | TLE | - |
testcase_04 | TLE | - |
testcase_05 | TLE | - |
testcase_06 | TLE | - |
testcase_07 | TLE | - |
testcase_08 | TLE | - |
testcase_09 | TLE | - |
testcase_10 | TLE | - |
testcase_11 | AC | 1,804 ms
77,252 KB |
ソースコード
from math import gcd def bis(ok, ng): while abs(ok - ng) > 1: md = (ng + ok) // 2 cnt = md - md//A - md//B + md//L if cnt >= K: ok = md else: ng = md return ok T = int(input()) for _ in range(T): A, B, K = map(int, input().split()) L = A // gcd(A, B) * B print(bis(10**19, 0))