結果
問題 | No.2526 Kth Not-divisible Number |
ユーザー |
👑 |
提出日時 | 2023-07-07 00:01:18 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 228 bytes |
コンパイル時間 | 425 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 17,696 KB |
最終ジャッジ日時 | 2024-09-25 19:09:51 |
合計ジャッジ時間 | 4,201 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 2 TLE * 1 -- * 8 |
ソースコード
I=input 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 N-N//A-N//B+N//C>=K:N-=1 while N-N//A-N//B+N//C<K:N+=1 print(N)