結果

問題 No.1700 floor X
ユーザー yassu0320yassu0320
提出日時 2021-11-05 00:25:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 227 ms / 2,000 ms
コード長 921 bytes
コンパイル時間 387 ms
コンパイル使用メモリ 86,948 KB
実行使用メモリ 81,204 KB
最終ジャッジ日時 2023-09-16 09:35:36
合計ジャッジ時間 12,074 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 164 ms
79,136 KB
testcase_01 AC 219 ms
80,756 KB
testcase_02 AC 217 ms
80,816 KB
testcase_03 AC 216 ms
80,892 KB
testcase_04 AC 213 ms
80,980 KB
testcase_05 AC 216 ms
80,704 KB
testcase_06 AC 218 ms
80,700 KB
testcase_07 AC 219 ms
81,124 KB
testcase_08 AC 213 ms
80,972 KB
testcase_09 AC 216 ms
80,896 KB
testcase_10 AC 214 ms
80,896 KB
testcase_11 AC 212 ms
80,928 KB
testcase_12 AC 211 ms
80,840 KB
testcase_13 AC 217 ms
80,816 KB
testcase_14 AC 218 ms
80,956 KB
testcase_15 AC 215 ms
80,900 KB
testcase_16 AC 216 ms
80,752 KB
testcase_17 AC 218 ms
80,936 KB
testcase_18 AC 219 ms
81,160 KB
testcase_19 AC 216 ms
80,956 KB
testcase_20 AC 218 ms
81,048 KB
testcase_21 AC 225 ms
80,784 KB
testcase_22 AC 224 ms
80,812 KB
testcase_23 AC 223 ms
80,976 KB
testcase_24 AC 220 ms
80,976 KB
testcase_25 AC 227 ms
81,072 KB
testcase_26 AC 221 ms
80,896 KB
testcase_27 AC 223 ms
80,816 KB
testcase_28 AC 221 ms
80,820 KB
testcase_29 AC 222 ms
80,752 KB
testcase_30 AC 222 ms
80,940 KB
testcase_31 AC 223 ms
80,752 KB
testcase_32 AC 220 ms
81,204 KB
testcase_33 AC 225 ms
80,980 KB
testcase_34 AC 217 ms
81,040 KB
testcase_35 AC 218 ms
81,032 KB
testcase_36 AC 213 ms
80,852 KB
testcase_37 AC 223 ms
81,004 KB
testcase_38 AC 221 ms
80,812 KB
testcase_39 AC 224 ms
81,028 KB
testcase_40 AC 224 ms
81,052 KB
testcase_41 AC 224 ms
80,976 KB
testcase_42 AC 163 ms
79,092 KB
testcase_43 AC 224 ms
80,976 KB
testcase_44 AC 224 ms
81,044 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3

from pprint import pprint
from sys import setrecursionlimit, stdin
from typing import Dict, Iterable, Set

INF: int = 1 << 62
setrecursionlimit(1_000_000)


def inputs(type_=int):
    ins = input().split()

    if isinstance(type_, Iterable):
        return [t(x) for t, x in zip(type_, ins)]
    else:
        return list(map(type_, ins))


def input_(type_=int):
    a, = inputs(type_)
    return a


def input1() -> int:
    return int(input())
inputi = input1


def inputstr():
    return input_(str)


def answer(res) -> None:
    print(res)
    exit()

def isqrt(n):
    """
    計算量はO(log(n))以下である. (O(loglog(n))?)
    Ref: http://www.ritsumei.ac.jp/se/~osaka/rejime/suuti/suuti2001.pdf
    """
    x, y = n, (n + 1) // 2
    while y < x:
        x, y = y, (y + n // y) // 2
    return x

# start coding
t = inputi()
for i in range(t):
    x = inputi()
    print(isqrt(x))
0