結果

問題 No.1700 floor X
ユーザー 👑 KazunKazun
提出日時 2021-10-08 21:52:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 478 bytes
コンパイル時間 246 ms
コンパイル使用メモリ 87,180 KB
実行使用メモリ 79,112 KB
最終ジャッジ日時 2023-09-16 08:56:54
合計ジャッジ時間 7,764 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,400 KB
testcase_01 AC 132 ms
78,868 KB
testcase_02 AC 128 ms
78,760 KB
testcase_03 AC 133 ms
79,112 KB
testcase_04 AC 128 ms
78,744 KB
testcase_05 AC 130 ms
78,728 KB
testcase_06 AC 130 ms
78,652 KB
testcase_07 AC 129 ms
78,824 KB
testcase_08 AC 130 ms
78,888 KB
testcase_09 AC 128 ms
78,768 KB
testcase_10 AC 129 ms
79,004 KB
testcase_11 AC 129 ms
78,764 KB
testcase_12 AC 130 ms
78,652 KB
testcase_13 AC 127 ms
78,704 KB
testcase_14 AC 127 ms
78,748 KB
testcase_15 AC 128 ms
78,960 KB
testcase_16 AC 129 ms
79,000 KB
testcase_17 AC 128 ms
78,984 KB
testcase_18 AC 130 ms
78,792 KB
testcase_19 AC 127 ms
78,892 KB
testcase_20 AC 129 ms
78,936 KB
testcase_21 AC 130 ms
78,844 KB
testcase_22 AC 130 ms
78,644 KB
testcase_23 AC 130 ms
78,948 KB
testcase_24 AC 130 ms
78,860 KB
testcase_25 AC 130 ms
78,824 KB
testcase_26 AC 128 ms
78,836 KB
testcase_27 AC 130 ms
78,924 KB
testcase_28 AC 130 ms
78,860 KB
testcase_29 AC 132 ms
78,732 KB
testcase_30 AC 131 ms
79,104 KB
testcase_31 AC 132 ms
78,708 KB
testcase_32 AC 131 ms
78,624 KB
testcase_33 AC 133 ms
79,048 KB
testcase_34 AC 132 ms
78,876 KB
testcase_35 AC 131 ms
78,624 KB
testcase_36 AC 129 ms
78,992 KB
testcase_37 AC 131 ms
78,740 KB
testcase_38 AC 128 ms
79,084 KB
testcase_39 AC 130 ms
78,620 KB
testcase_40 AC 130 ms
78,736 KB
testcase_41 AC 130 ms
78,640 KB
testcase_42 AC 69 ms
71,724 KB
testcase_43 AC 132 ms
78,400 KB
testcase_44 AC 137 ms
78,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def Floor_Root(a,k):
    """floor(a^(1/k)) を求める.

    a:非負整数
    k:正の整数
    """
    assert 0<=a and 0<k
    if a==0: return 0
    if k==1: return a

    #大体の値を求める.
    x=int(pow(a,1/k))

    #増やす
    while pow(x+1,k)<=a:
        x+=1

    #減らす
    while pow(x,k)>a:
        x-=1
    return x

#==================================================
T=int(input())

for _ in range(T):
    N=int(input())
    print(Floor_Root(N,2))
0