結果
| 問題 | No.3072 Speedrun Query |
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 18:10:02 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 704 bytes |
| 記録 | |
| コンパイル時間 | 226 ms |
| コンパイル使用メモリ | 95,212 KB |
| 実行使用メモリ | 90,496 KB |
| 最終ジャッジ日時 | 2026-07-11 18:53:53 |
| 合計ジャッジ時間 | 5,427 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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