結果
問題 |
No.2526 Kth Not-divisible Number
|
ユーザー |
👑 |
提出日時 | 2023-07-07 00:16:48 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,069 ms / 2,000 ms |
コード長 | 226 bytes |
コンパイル時間 | 278 ms |
コンパイル使用メモリ | 81,936 KB |
実行使用メモリ | 76,600 KB |
最終ジャッジ日時 | 2024-09-25 19:10:10 |
合計ジャッジ時間 | 6,893 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 11 |
ソースコード
I=input def f(): return N-N//A-N//B+N//C for t in range(int(I())): A,B,K=map(int,I().split()) C,D=A,B if A>B:C,D=D,C while C:C,D=D%C,C C=A*B//D N=int((K+1)/(1-1/A-1/B+1/C)) while f()>=K:N-=1 while f()<K:N+=1 print(N)