結果

問題 No.897 compαctree
ユーザー _KingdomOfMoray
提出日時 2020-01-08 20:00:43
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 411 bytes
コンパイル時間 275 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 21,376 KB
最終ジャッジ日時 2024-11-23 03:05:12
合計ジャッジ時間 10,316 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 10 TLE * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

def query_calc(n, k):
    nodes_per_stair = k ** 0
    ever_nodes = 1
    deep = 0

    while ever_nodes < n:
        deep += 1
        nodes_per_stair *= k
        ever_nodes += nodes_per_stair

    print(deep)

q = int(input())
n_list = []
k_list = []
for i in range(q):
    n, k = map(int,input().split())
    n_list.append(n)
    k_list.append(k)
    
for i in range(q):
    query_calc(n_list[i], k_list[i])
0