結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 164 ms
79,056 KB
testcase_01 AC 240 ms
82,336 KB
testcase_02 AC 242 ms
82,448 KB
testcase_03 AC 241 ms
82,252 KB
testcase_04 AC 241 ms
82,400 KB
testcase_05 AC 241 ms
82,796 KB
testcase_06 AC 242 ms
82,244 KB
testcase_07 AC 241 ms
82,536 KB
testcase_08 AC 242 ms
82,600 KB
testcase_09 AC 238 ms
82,648 KB
testcase_10 AC 241 ms
82,452 KB
testcase_11 AC 239 ms
82,332 KB
testcase_12 AC 243 ms
82,456 KB
testcase_13 AC 243 ms
82,520 KB
testcase_14 AC 242 ms
82,192 KB
testcase_15 AC 240 ms
82,508 KB
testcase_16 AC 240 ms
82,644 KB
testcase_17 AC 241 ms
82,252 KB
testcase_18 AC 242 ms
82,620 KB
testcase_19 AC 240 ms
82,332 KB
testcase_20 AC 238 ms
82,228 KB
testcase_21 AC 250 ms
82,416 KB
testcase_22 AC 246 ms
82,472 KB
testcase_23 AC 246 ms
82,432 KB
testcase_24 AC 245 ms
82,436 KB
testcase_25 AC 248 ms
82,412 KB
testcase_26 AC 243 ms
82,236 KB
testcase_27 AC 241 ms
82,584 KB
testcase_28 AC 246 ms
82,424 KB
testcase_29 AC 249 ms
82,240 KB
testcase_30 AC 247 ms
82,428 KB
testcase_31 AC 247 ms
82,744 KB
testcase_32 AC 249 ms
82,484 KB
testcase_33 AC 248 ms
82,480 KB
testcase_34 AC 249 ms
82,328 KB
testcase_35 AC 248 ms
82,436 KB
testcase_36 AC 247 ms
82,380 KB
testcase_37 AC 249 ms
82,436 KB
testcase_38 AC 249 ms
82,360 KB
testcase_39 AC 247 ms
82,440 KB
testcase_40 AC 249 ms
82,436 KB
testcase_41 AC 252 ms
82,456 KB
testcase_42 AC 163 ms
79,140 KB
testcase_43 AC 248 ms
82,432 KB
testcase_44 AC 248 ms
82,528 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


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