結果
問題 |
No.897 compαctree
|
ユーザー |
|
提出日時 | 2021-02-24 22:40:35 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 314 bytes |
コンパイル時間 | 171 ms |
コンパイル使用メモリ | 82,416 KB |
実行使用メモリ | 198,296 KB |
最終ジャッジ日時 | 2024-09-24 23:34:07 |
合計ジャッジ時間 | 3,694 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | TLE * 1 -- * 12 |
ソースコード
Q = int(input()) for case in range(Q): N, K = map(int, input().split()) if K == 1: print(N - 1) continue en = N + 1 st = -1 while en - st > 1: d = (en + st) // 2 if pow(K, d + 1) >= N * K - N + 1: en = d else: st = d print(en)