結果

問題 No.8072 Sum of sqrt(x)
ユーザー titia
提出日時 2024-09-27 04:41:46
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 447 bytes
コンパイル時間 725 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 99,584 KB
最終ジャッジ日時 2024-09-27 04:42:02
合計ジャッジ時間 15,608 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 4 TLE * 1 -- * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
from decimal import *
getcontext().prec = 50

N=int(input())
X=[int(input()) for i in range(N)]

ANS=[]

score=Decimal(0)
for x in X:
    x*=10**40

    MIN=Decimal(0)
    MAX=Decimal(x)
    for i in range(300):
        mid=(MAX+MIN)/2

        if mid*mid>x:
            MAX=mid
        else:
            MIN=mid

    score+=(Decimal(MAX+MIN)/2/10**20)

    ANS.append(score)


print("\n".join(map(str,ANS)))
0