結果

問題 No.897 compαctree
ユーザー gorugo30gorugo30
提出日時 2021-02-24 22:39:03
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 311 bytes
コンパイル時間 436 ms
コンパイル使用メモリ 81,904 KB
実行使用メモリ 197,468 KB
最終ジャッジ日時 2023-10-25 04:07:31
合計ジャッジ時間 4,323 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
57,924 KB
testcase_01 TLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

Q = int(input())
for case in range(Q):
    N, K = map(int, input().split())
    en = N + 1
    st = -1
    while en - st > 1:
        d = (en + st) // 2
        if K ** (d + 1) >= N * K - N + 1:
            en = d
        else:
            st = d
    if en == 0:
        print(N - 1)
    else:
        print(en)
0