結果
問題 | No.2526 Kth Not-divisible Number |
ユーザー | nikoro256 |
提出日時 | 2023-11-03 21:52:17 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,169 ms / 2,000 ms |
コード長 | 358 bytes |
コンパイル時間 | 220 ms |
コンパイル使用メモリ | 81,988 KB |
実行使用メモリ | 76,672 KB |
最終ジャッジ日時 | 2024-09-25 20:03:20 |
合計ジャッジ時間 | 10,785 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 11 |
ソースコード
import math def isok(n): ans=n-n//A-n//B+n//math.lcm(A,B) if ans<K: return True return False T=int(input()) for _ in range(T): A,B,K=map(int,input().split()) left,right=0,3*10**18+1 while right-left>1: mid=(right+left)//2 if isok(mid): left=mid else: right=mid print(right)