結果

問題 No.3072 Speedrun Query
コンテスト
ユーザー gew1fw
提出日時 2025-06-12 19:51:01
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
RE  
実行時間 -
コード長 669 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 251 ms
コンパイル使用メモリ 95,216 KB
実行使用メモリ 91,776 KB
最終ジャッジ日時 2026-07-11 22:39:12
合計ジャッジ時間 6,636 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 1
other RE * 21
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from decimal import Decimal, getcontext

getcontext().prec = 30  # Set precision high enough to handle sqrt accurately

n = int(input())
sum_so_far = Decimal(0)

for _ in range(n):
    x = int(input())
    xi = Decimal(x)
    sqrt_x = xi.sqrt()
    sum_so_far += sqrt_x
    
    # Format the sum to have exactly 17 decimal places
    s = format(sum_so_far, 'f')  # Convert to fixed-point string
    if '.' in s:
        integer_part, fractional_part = s.split('.')
        fractional_part = fractional_part.ljust(17, '0')[:17]
    else:
        integer_part = s
        fractional_part = '0' * 17
    formatted = f"{integer_part}.{fractional_part}"
    print(formatted)
0