結果
問題 |
No.8072 Sum of sqrt(x)
|
ユーザー |
![]() |
提出日時 | 2021-10-24 18:48:46 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 894 bytes |
コンパイル時間 | 609 ms |
コンパイル使用メモリ | 81,792 KB |
実行使用メモリ | 94,720 KB |
最終ジャッジ日時 | 2024-10-02 02:59:30 |
合計ジャッジ時間 | 60,788 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 8 WA * 12 TLE * 7 |
ソースコード
import sys from operator import itemgetter from collections import defaultdict, deque import heapq import bisect import math import itertools import decimal 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]) ############################################################### decimal.getcontext().prec=20 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)