結果
| 問題 |
No.3072 Speedrun Query
|
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 19:59:38 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 756 bytes |
| コンパイル時間 | 270 ms |
| コンパイル使用メモリ | 81,664 KB |
| 実行使用メモリ | 80,172 KB |
| 最終ジャッジ日時 | 2025-06-12 20:02:47 |
| 合計ジャッジ時間 | 6,144 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 2 TLE * 1 -- * 18 |
ソースコード
from decimal import Decimal, getcontext
import sys
def main():
# Set high precision to ensure accuracy
getcontext().prec = 40 # Sufficient for 1e-15 precision
# Read all input at once for efficiency
data = sys.stdin.read().split()
n = int(data[0])
x_list = data[1:n+1]
# Precompute square roots and sums
current_sum = Decimal(0)
sums = []
for xi_str in x_list:
xi = Decimal(xi_str)
sqrt_xi = xi.sqrt()
current_sum += sqrt_xi
sums.append(current_sum)
# Format each sum for output
for s in sums:
s_str = format(s, 'f').rstrip('0').rstrip('.') if '.' in str(s) else str(s)
print(s_str if '.' in s_str else s_str + '.0')
if __name__ == "__main__":
main()
gew1fw