結果

問題 No.897 compαctree
ユーザー akanayaakanaya
提出日時 2020-03-29 16:48:30
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 92 ms / 2,000 ms
コード長 310 bytes
コンパイル時間 275 ms
コンパイル使用メモリ 87,300 KB
実行使用メモリ 72,124 KB
最終ジャッジ日時 2023-08-30 19:48:55
合計ジャッジ時間 2,329 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
71,828 KB
testcase_01 AC 91 ms
71,808 KB
testcase_02 AC 91 ms
71,852 KB
testcase_03 AC 92 ms
71,712 KB
testcase_04 AC 91 ms
71,644 KB
testcase_05 AC 92 ms
71,580 KB
testcase_06 AC 90 ms
72,124 KB
testcase_07 AC 90 ms
71,680 KB
testcase_08 AC 92 ms
71,804 KB
testcase_09 AC 92 ms
71,788 KB
testcase_10 AC 91 ms
71,848 KB
testcase_11 AC 90 ms
71,532 KB
testcase_12 AC 91 ms
71,640 KB
testcase_13 AC 91 ms
71,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
import sys
from collections import Counter

q = int(input())

nkq = [None] * q
for i in range(q):
    nkq[i] = list(map(int, input().split(' ')))

for nk in nkq:
    if nk[1] == 1:
        print(nk[0] -1)
    else:
        n = math.floor(math.log(nk[0] * (nk[1] - 1) + 1, nk[1]))
        print(n)

0