結果
| 問題 |
No.3072 Speedrun Query
|
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 18:13:26 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 704 bytes |
| コンパイル時間 | 155 ms |
| コンパイル使用メモリ | 82,332 KB |
| 実行使用メモリ | 67,564 KB |
| 最終ジャッジ日時 | 2025-06-12 18:14:47 |
| 合計ジャッジ時間 | 3,313 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 1 |
| other | RE * 21 |
ソースコード
import math
import sys
def main():
n = int(sys.stdin.readline())
x = [int(sys.stdin.readline()) for _ in range(n)]
sum_total = 0.0
compensation = 0.0
for xi in x:
term = math.sqrt(xi)
# Kahan summation steps
y = term - compensation
t = sum_total + y
compensation = (t - sum_total) - y
sum_total = t
# Formatting the output
s = "{0:.17f}".format(sum_total)
integer_part, decimal_part = s.split('.')
decimal_part = decimal_part.rstrip('0')
if not decimal_part:
decimal_part = '0'
print(f"{integer_part}.{decimal_part}")
if __name__ == "__main__":
main()
gew1fw