結果

問題 No.1700 floor X
ユーザー yassu0320yassu0320
提出日時 2021-11-05 00:16:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 258 ms / 2,000 ms
コード長 917 bytes
コンパイル時間 463 ms
コンパイル使用メモリ 87,148 KB
実行使用メモリ 82,844 KB
最終ジャッジ日時 2023-09-16 09:35:02
合計ジャッジ時間 13,490 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 171 ms
79,208 KB
testcase_01 AC 252 ms
82,468 KB
testcase_02 AC 250 ms
82,632 KB
testcase_03 AC 248 ms
82,464 KB
testcase_04 AC 249 ms
82,832 KB
testcase_05 AC 248 ms
82,808 KB
testcase_06 AC 250 ms
82,708 KB
testcase_07 AC 250 ms
82,604 KB
testcase_08 AC 247 ms
82,584 KB
testcase_09 AC 247 ms
82,824 KB
testcase_10 AC 247 ms
82,616 KB
testcase_11 AC 244 ms
82,608 KB
testcase_12 AC 248 ms
82,640 KB
testcase_13 AC 250 ms
82,584 KB
testcase_14 AC 253 ms
82,488 KB
testcase_15 AC 251 ms
82,724 KB
testcase_16 AC 250 ms
82,584 KB
testcase_17 AC 250 ms
82,456 KB
testcase_18 AC 248 ms
82,576 KB
testcase_19 AC 246 ms
82,708 KB
testcase_20 AC 246 ms
82,648 KB
testcase_21 AC 254 ms
82,468 KB
testcase_22 AC 253 ms
82,628 KB
testcase_23 AC 258 ms
82,660 KB
testcase_24 AC 258 ms
82,712 KB
testcase_25 AC 257 ms
82,488 KB
testcase_26 AC 258 ms
82,672 KB
testcase_27 AC 253 ms
82,820 KB
testcase_28 AC 254 ms
82,624 KB
testcase_29 AC 251 ms
82,452 KB
testcase_30 AC 252 ms
82,572 KB
testcase_31 AC 254 ms
82,688 KB
testcase_32 AC 253 ms
82,668 KB
testcase_33 AC 255 ms
82,844 KB
testcase_34 AC 254 ms
82,636 KB
testcase_35 AC 254 ms
82,644 KB
testcase_36 AC 253 ms
82,492 KB
testcase_37 AC 255 ms
82,428 KB
testcase_38 AC 256 ms
82,628 KB
testcase_39 AC 255 ms
82,728 KB
testcase_40 AC 256 ms
82,688 KB
testcase_41 AC 256 ms
82,636 KB
testcase_42 AC 164 ms
79,136 KB
testcase_43 AC 253 ms
82,656 KB
testcase_44 AC 255 ms
82,632 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(' ')
    ins = [x for x in ins if x != '']

    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


inputi = input_


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