結果

問題 No.3072 Speedrun Query
ユーザー gew1fw
提出日時 2025-06-12 14:51:58
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 664 bytes
コンパイル時間 240 ms
コンパイル使用メモリ 82,232 KB
実行使用メモリ 192,668 KB
最終ジャッジ日時 2025-06-12 14:55:17
合計ジャッジ時間 5,658 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 1
other WA * 2 TLE * 1 -- * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from decimal import Decimal, getcontext

getcontext().prec = 30  # Set a high precision

def main():
    input = sys.stdin.read().split()
    n = int(input[0])
    x_list = list(map(int, input[1:n+1]))
    
    current_sum = Decimal(0)
    sums = []
    for x in x_list:
        sqrt_x = Decimal(x).sqrt()
        current_sum += sqrt_x
        sums.append(current_sum)
    
    for s in sums:
        s_str = format(s, 'f')  # Convert to fixed-point string
        # Remove trailing zeros and unnecessary decimal point
        if '.' in s_str:
            s_str = s_str.rstrip('0').rstrip('.')
        print(s_str)

if __name__ == "__main__":
    main()
0