結果

問題 No.3072 Sum of sqrt(x)
ユーザー asumo0729asumo0729
提出日時 2021-10-24 18:43:46
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 851 bytes
コンパイル時間 449 ms
コンパイル使用メモリ 82,392 KB
実行使用メモリ 83,576 KB
最終ジャッジ日時 2024-04-10 01:42:08
合計ジャッジ時間 53,925 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
55,316 KB
testcase_01 AC 43 ms
55,528 KB
testcase_02 AC 44 ms
56,044 KB
testcase_03 AC 41 ms
55,228 KB
testcase_04 AC 40 ms
54,648 KB
testcase_05 AC 43 ms
56,368 KB
testcase_06 AC 42 ms
54,632 KB
testcase_07 WA -
testcase_08 AC 588 ms
83,576 KB
testcase_09 AC 699 ms
80,100 KB
testcase_10 AC 989 ms
80,240 KB
testcase_11 AC 1,447 ms
80,772 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 TLE -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from operator import itemgetter
from collections import defaultdict, deque
import heapq
import bisect
import math
import itertools

stdin=sys.stdin
sys.setrecursionlimit(10 ** 8)

ip=lambda: int(sp())
fp=lambda: float(sp())
lp=lambda:list(map(int,stdin.readline().split()))
sp=lambda:stdin.readline().rstrip()
Yp=lambda:print('Yes')
Np=lambda:print('No')
inf = 1 << 60
inf1 = float('inf')
mod = 10 ** 9 + 7
mod = 998244353
eps = 1e-9
sortkey1 = itemgetter(0)
sortkey2 = lambda x: (x[0], x[1])

###############################################################

N = ip()

def f(x):
    t = math.sqrt(x)
    ok = t - 1; ng = t + 1
    for _ in range(50):
        mid = (ok + ng) / 2
        if mid > t:
            ng = mid
        else:
            ok = mid
    return ok

ans = 0
for _ in range(N):
    x = ip()
    ans += f(x)
    print(ans)
0