結果

問題 No.897 compαctree
ユーザー mlihua09
提出日時 2020-08-31 23:49:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 235 bytes
コンパイル時間 247 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 52,224 KB
最終ジャッジ日時 2024-11-17 02:57:41
合計ジャッジ時間 1,489 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #


for _ in range(int(input())):
    
    N, K = map(int, input().split())
    
    x = 1
    j = 0
    if K == 1:
        print(N - 1)
        continue
    while N > x:
        x *= K
        x += 1
        j += 1
        
    print(j)
0