結果

問題 No.897 compαctree
ユーザー ttrttr
提出日時 2020-02-04 18:43:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 224 bytes
コンパイル時間 222 ms
コンパイル使用メモリ 11,828 KB
実行使用メモリ 14,448 KB
最終ジャッジ日時 2023-10-21 06:28:27
合計ジャッジ時間 4,395 ms
ジャッジサーバーID
(参考情報)
judge10 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
14,448 KB
testcase_01 AC 24 ms
10,100 KB
testcase_02 AC 24 ms
10,100 KB
testcase_03 AC 28 ms
10,100 KB
testcase_04 AC 27 ms
10,100 KB
testcase_05 AC 25 ms
10,100 KB
testcase_06 AC 25 ms
10,100 KB
testcase_07 AC 26 ms
10,100 KB
testcase_08 AC 24 ms
10,100 KB
testcase_09 AC 25 ms
10,100 KB
testcase_10 AC 25 ms
10,100 KB
testcase_11 TLE -
testcase_12 -- -
testcase_13 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

Q = int(input())

def S(r, n):
    if r == 1:
        return n+1
    return (pow(r, n+1)-1)//(r-1)

for _ in range(Q):
    N,K = map(int, input().split())
    ans = 0
    while S(K, ans) < N:
        ans += 1
    print(ans)
0