結果
| 問題 | No.2526 Kth Not-divisible Number |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-11-03 21:35:49 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1,436 ms / 2,000 ms |
| + 941µs | |
| コード長 | 460 bytes |
| 記録 | |
| コンパイル時間 | 247 ms |
| コンパイル使用メモリ | 95,928 KB |
| 実行使用メモリ | 101,992 KB |
| 最終ジャッジ日時 | 2026-09-04 07:49:31 |
| 合計ジャッジ時間 | 16,191 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 11 |
ソースコード
import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random
#sys.setrecursionlimit(10**9)
input = sys.stdin.readline
def solve():
a,b,k = map(int,input().split())
c = a*b//math.gcd(a,b)
l,r = 0,10**20
while r-l > 1:
m = (l+r)//2
cnt = m // a + m // b - m // c
if m - cnt >= k:
r = m
else:
l = m
print(r)
for _ in range(int(input())):
solve()