結果

問題 No.1700 floor X
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2021-10-08 23:32:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 282 ms / 2,000 ms
コード長 402 bytes
コンパイル時間 177 ms
コンパイル使用メモリ 10,712 KB
実行使用メモリ 7,980 KB
最終ジャッジ日時 2023-09-16 09:22:19
合計ジャッジ時間 13,429 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,784 KB
testcase_01 AC 257 ms
7,744 KB
testcase_02 AC 255 ms
7,836 KB
testcase_03 AC 253 ms
7,780 KB
testcase_04 AC 254 ms
7,828 KB
testcase_05 AC 254 ms
7,916 KB
testcase_06 AC 257 ms
7,832 KB
testcase_07 AC 255 ms
7,820 KB
testcase_08 AC 255 ms
7,876 KB
testcase_09 AC 256 ms
7,780 KB
testcase_10 AC 255 ms
7,744 KB
testcase_11 AC 256 ms
7,920 KB
testcase_12 AC 257 ms
7,892 KB
testcase_13 AC 255 ms
7,784 KB
testcase_14 AC 256 ms
7,832 KB
testcase_15 AC 256 ms
7,828 KB
testcase_16 AC 256 ms
7,832 KB
testcase_17 AC 255 ms
7,952 KB
testcase_18 AC 255 ms
7,856 KB
testcase_19 AC 258 ms
7,856 KB
testcase_20 AC 256 ms
7,872 KB
testcase_21 AC 273 ms
7,816 KB
testcase_22 AC 271 ms
7,916 KB
testcase_23 AC 275 ms
7,980 KB
testcase_24 AC 274 ms
7,832 KB
testcase_25 AC 272 ms
7,848 KB
testcase_26 AC 272 ms
7,824 KB
testcase_27 AC 272 ms
7,836 KB
testcase_28 AC 274 ms
7,780 KB
testcase_29 AC 275 ms
7,836 KB
testcase_30 AC 273 ms
7,852 KB
testcase_31 AC 276 ms
7,888 KB
testcase_32 AC 273 ms
7,780 KB
testcase_33 AC 272 ms
7,820 KB
testcase_34 AC 273 ms
7,748 KB
testcase_35 AC 273 ms
7,820 KB
testcase_36 AC 274 ms
7,744 KB
testcase_37 AC 272 ms
7,836 KB
testcase_38 AC 272 ms
7,920 KB
testcase_39 AC 275 ms
7,844 KB
testcase_40 AC 274 ms
7,964 KB
testcase_41 AC 276 ms
7,744 KB
testcase_42 AC 16 ms
7,808 KB
testcase_43 AC 278 ms
7,812 KB
testcase_44 AC 282 ms
7,964 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def floor_sqrt(n):
    
    y = 10**20
    
    def is_smaller(x):
        if x**2 <= n:
            return True
        return False
    
    x = 0
    while y-x>1:
        mid = (y+x)//2
        if is_smaller(mid):
            x = mid
        else:
            y = mid
    return x
    
def answer():
    n = int(input())
    print(floor_sqrt(n))
    
t = int(input())
for _ in range(t):
    answer()
0