結果

問題 No.897 compαctree
ユーザー fV9TwBhUoa9S3eV
提出日時 2019-10-31 09:10:42
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 381 bytes
コンパイル時間 348 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-09-14 22:01:05
合計ジャッジ時間 1,584 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

# No.897 compαctree
q = int(input())
n = []
k = []

for i in range(q):
    tmp = [int(s) for s in input().split()]
    n.append(tmp[0])
    k.append(tmp[1])

for i in range(q):
    if k[i] == 1:
        print(n[i] - 1)
    else:
        depth = 1
        points = 1

        while points < n[i]:
            points += k[i] ** depth
            depth += 1

        print(depth - 1)
0