結果

問題 No.3072 Speedrun Query
ユーザー lam6er
提出日時 2025-04-15 20:56:59
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 478 bytes
コンパイル時間 410 ms
コンパイル使用メモリ 82,708 KB
実行使用メモリ 176,088 KB
最終ジャッジ日時 2025-04-15 21:00:13
合計ジャッジ時間 12,720 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 1
other WA * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
import sys

def main():
    input = sys.stdin.read().split()
    n = int(input[0])
    xs = list(map(int, input[1:n+1]))
    sum_ = 0.0
    compensation = 0.0
    for x in xs:
        s = math.sqrt(x)
        # Kahan summation steps
        y = s - compensation
        t = sum_ + y
        compensation = (t - sum_) - y
        sum_ = t
        # Print with 17 decimal places
        print("{0:.17f}".format(sum_))
            
if __name__ == "__main__":
    main()
0