結果
問題 | No.2526 Kth Not-divisible Number |
ユーザー |
|
提出日時 | 2023-11-03 21:32:35 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 525 ms / 2,000 ms |
コード長 | 544 bytes |
コンパイル時間 | 170 ms |
コンパイル使用メモリ | 82,448 KB |
実行使用メモリ | 78,624 KB |
最終ジャッジ日時 | 2024-09-25 19:25:39 |
合計ジャッジ時間 | 6,430 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 11 |
ソースコード
import syssys.setrecursionlimit(5*10**5)input = sys.stdin.readlinefrom collections import defaultdict, deque, Counterfrom heapq import heappop, heappushfrom bisect import bisect_left, bisect_rightfrom math import gcddef sol():a,b,k = map(int,input().split())ab = a*b//gcd(a,b)l = 0r = 4*10**18for i in range(70):m = (l+r)//2cnt = m-m//a-m//b+m//abif cnt < k:l = melse:r = mprint(*[r])returnT = int(input())for i in range(T):sol()