結果

問題 No.897 compαctree
コンテスト
ユーザー yaneko
提出日時 2025-11-19 17:30:41
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 241 bytes
コンパイル時間 246 ms
コンパイル使用メモリ 82,108 KB
実行使用メモリ 67,016 KB
最終ジャッジ日時 2025-11-19 17:30:45
合計ジャッジ時間 4,413 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 10 TLE * 1 -- * 2
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

if __name__=='__main__':
    for _ in range(int(input())):
        n, k = map(int, input().split())
        ans = 0
        n -= 1
        t = k
        while n>0:
            n -= t
            t *= k
            ans += 1
        print(ans)
0