結果
| 問題 |
No.1700 floor X
|
| コンテスト | |
| ユーザー |
yassu0320
|
| 提出日時 | 2021-11-05 00:25:19 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 162 ms / 2,000 ms |
| コード長 | 921 bytes |
| コンパイル時間 | 234 ms |
| コンパイル使用メモリ | 82,240 KB |
| 実行使用メモリ | 82,012 KB |
| 最終ジャッジ日時 | 2024-07-03 10:48:03 |
| 合計ジャッジ時間 | 8,443 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 44 |
ソースコード
#!/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))
yassu0320