結果

問題 No.897 compαctree
ユーザー toshiro_yanagi
提出日時 2020-07-19 21:55:03
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 204 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 82,516 KB
実行使用メモリ 113,004 KB
最終ジャッジ日時 2024-12-17 14:48:36
合計ジャッジ時間 10,192 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 10 TLE * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin

q = int(input())
for _ in range(q):
    n, k = map(int, stdin.readline().split())
    ans = 0
    a = 1
    i = 1
    while a < n:
        a += k**i
        i += 1
    print(i - 1)
0