結果

問題 No.897 compαctree
ユーザー GrayCoder
提出日時 2019-10-04 21:56:13
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 362 bytes
コンパイル時間 139 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-10-03 07:34:53
合計ジャッジ時間 1,308 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 3 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import modf
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    Q = int(input())
    NK = [tuple(map(int, input().split())) for _ in [0] * Q]

    for n, k in NK:
        if k == 1:
            print(n - 1)
        else:
            m, d = modf(n ** (1 / k))
            print(int(d + 1)) if m else print(int(d))


main()
0